Skip to content

Commit

Permalink
code refactoring replace _o_Cx by var :....
Browse files Browse the repository at this point in the history
  • Loading branch information
delahaye-4D committed Sep 30, 2024
1 parent 22c21aa commit c67d0d4
Show file tree
Hide file tree
Showing 7 changed files with 643 additions and 655 deletions.
37 changes: 15 additions & 22 deletions Project/Sources/Methods/_max.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,32 @@
//
// ----------------------------------------------------
// Declarations
C_REAL:C285($0)
C_REAL:C285($1)
C_REAL:C285($2)
C_REAL:C285(${3})

C_LONGINT:C283($Lon_i; $Lon_parameters)
C_REAL:C285($Num_max; $Num_value_1; $Num_value_2)
#DECLARE($value_1 : Real; $value_2 : Real; ... : Real) : Real


var $i; $count_parameters : Integer

var $max : Real

If (False:C215)
C_REAL:C285(_max; $0)
C_REAL:C285(_max; $1)
C_REAL:C285(_max; $2)
C_REAL:C285(_max; ${3})
End if

// ----------------------------------------------------
// Initialisations
$Lon_parameters:=Count parameters:C259
$count_parameters:=Count parameters:C259

If (Asserted:C1132($Lon_parameters>=2; "Missing parameter"))
If (Asserted:C1132($count_parameters>=2; "Missing parameter"))

//Required parameters
$Num_value_1:=$1
$Num_value_2:=$2


//Optional parameters
If ($Lon_parameters>=3)
If ($count_parameters>=3)

// <NONE>

End if

$Num_max:=$Num_value_1
$max:=$value_1

Else

Expand All @@ -50,19 +43,19 @@ Else
End if

// ----------------------------------------------------
For ($Lon_i; 2; $Lon_parameters; 1)
For ($i; 2; $count_parameters; 1)

If (${$Lon_i}>$Num_max)
If (${$i}>$max)

$Num_max:=${$Lon_i}
$max:=${$i}

End if

End for

// ----------------------------------------------------
// Return
$0:=$Num_max
return $max

// ----------------------------------------------------
// End
14 changes: 4 additions & 10 deletions Project/Sources/Methods/env_Substitute_font.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@
// ----------------------------------------------------
// Declarations

#DECLARE($font_name : Text)->$font_substitution : Text
#DECLARE($font_name : Text) : Text


var \
$count_parameters : Integer
var $count_parameters : Integer
var $font_substitution : Text


If (False:C215)
C_TEXT:C284(env_Substitute_font; $0)
C_TEXT:C284(env_Substitute_font; $1)
End if

// ----------------------------------------------------
// Initialisations
$count_parameters:=Count parameters:C259
Expand All @@ -33,7 +28,6 @@ If (Asserted:C1132($count_parameters>=0; "Missing parameter"))
//Optional parameters
If ($count_parameters>=1)

//$Txt_fontName:=$1 //{default font if omitted}

Else

Expand Down Expand Up @@ -74,7 +68,7 @@ End case

// ----------------------------------------------------
// Return
//$0:=$Txt_fontSubstituted
return $font_substitution

// ----------------------------------------------------
// End
Loading

0 comments on commit c67d0d4

Please sign in to comment.