diff --git a/Project/Sources/Classes/_modernize.4dm b/Project/Sources/Classes/_modernize.4dm index 28e11fa..4a8544c 100644 --- a/Project/Sources/Classes/_modernize.4dm +++ b/Project/Sources/Classes/_modernize.4dm @@ -8,8 +8,10 @@ Class constructor // Replace declaration lines using the old “(_o_)C_xxx(...)” syntax with the new one “var ... : type”. Function C_2var() : Boolean - var $pattern : Text:="(?-msi)(?0 ? $groups.indexOf(String:C10($current)) : $current + var $groupIndex : Integer + $groupIndex:=$groups.length>0 ? $groups.indexOf(String:C10($current)) : $current If ($groupIndex>=0) @@ -285,9 +291,10 @@ Function extract($groups) : Collection If (This:C1470.matches.query("data = :1 & pos = :2"; Substring:C12(This:C1470._target; $pos{$i}; $len{$i}); $pos{$i}).pop()=Null:C1517) + $substring:=Substring:C12(This:C1470._target; $pos{$i}; $len{$i}) This:C1470.matches.push({\ index: $indx; \ - data: Substring:C12(This:C1470._target; $pos{$i}; $len{$i}); \ + data: $substring; \ pos: $pos{$i}; \ len: $len{$i}\ }) @@ -329,7 +336,7 @@ Function extract($groups) : Collection // Replace matching substrings with the replacement text. Function substitute($replacement : Text; $count : Integer; $position : Integer) : Text - var $replacedText : Text + var $replacedText; $substring : Text var $i; $index : Integer var $o : Object @@ -338,21 +345,25 @@ Function substitute($replacement : Text; $count : Integer; $position : Integer) // TODO:Manage count and position - var $backup : Text:=$replacement + var $backup : Text + $backup:=$replacement This:C1470._init() - var $start : Integer:=1 + var $start : Integer + $start:=1 Repeat - var $match : Boolean:=Try(Match regex:C1019(This:C1470._pattern; This:C1470._target; $start; $pos; $len)) + var $match : Boolean + $match:=Match regex:C1019(This:C1470._pattern; This:C1470._target; $start; $pos; $len) If (Last errors:C1799.length=0) If ($match) - var $sub : Integer:=0 + var $sub : Integer + $sub:=0 For ($i; 0; Size of array:C274($pos); 1) @@ -374,10 +385,10 @@ Function substitute($replacement : Text; $count : Integer; $position : Integer) End if If ($match) - + $substring:=Substring:C12(This:C1470._target; $pos{$i}; $len{$i}) This:C1470.matches.push({\ index: $index; \ - data: Substring:C12(This:C1470._target; $pos{$i}; $len{$i}); \ + data: $substring; \ pos: $pos{$i}; \ len: $len{$i}; \ _subpattern: $sub\ @@ -415,7 +426,8 @@ Function substitute($replacement : Text; $count : Integer; $position : Integer) If ($o._subpattern#0) - var $subexpression : Text:="\\"+String:C10($o._subpattern) + var $subexpression : Text + $subexpression:="\\"+String:C10($o._subpattern) If (Position:C15($subexpression; $replacement)>0) @@ -454,7 +466,8 @@ Function lookingAt() : Boolean This:C1470._init() - var $match : Boolean:=Try(Match regex:C1019(This:C1470._pattern; This:C1470._target; 1; *)) + var $match : Boolean + $match:=Match regex:C1019(This:C1470._pattern; This:C1470._target; 1; *) This:C1470.success:=(Last errors:C1799.length=0) && ($match) This:C1470.searchTime:=This:C1470._elapsedTime() diff --git a/Project/Sources/Classes/macros.4dm b/Project/Sources/Classes/macros.4dm index c096700..6e3d341 100755 --- a/Project/Sources/Classes/macros.4dm +++ b/Project/Sources/Classes/macros.4dm @@ -139,7 +139,7 @@ Function tokenise() For ($process; 1; Count tasks:C335; 1) - Try(_O_PROCESS PROPERTIES:C336($process; $name; $state; $time; $mode; $UID; $origin)) + PROCESS PROPERTIES:C336($process; $name; $state; $time; $mode; $UID; $origin) If ($origin=Design process:K36:9) @@ -157,14 +157,15 @@ If not, suggest to create it. */ Function test_macro() : Boolean - var $t : Text:="test_macro" + var $t : Text + $t:="test_macro" ARRAY TEXT:C222($_t; 0) METHOD GET NAMES:C1166($_t; $t; *) If (Size of array:C274($_t)>0) - return Formula from string:C1601($t; sk execute in host database:K88:5).call() + return Formula from string:C1601($t).call() Else diff --git a/Project/Sources/Methods/_MACROS.4dm b/Project/Sources/Methods/_MACROS.4dm index 21eb21a..36211ad 100644 --- a/Project/Sources/Methods/_MACROS.4dm +++ b/Project/Sources/Methods/_MACROS.4dm @@ -2,7 +2,8 @@ #DECLARE($action : Text) var $success : Boolean -var $macro : cs:C1710.macros:=cs:C1710.macros.new() +var $macro : cs:C1710.macros +$macro:=cs:C1710.macros.new() If (OB Instance of:C1731($macro[$action]; 4D:C1709.Function)) diff --git a/Project/Sources/Methods/test_macro.4dm b/Project/Sources/Methods/test_macro.4dm index e13438d..bd577f2 100644 --- a/Project/Sources/Methods/test_macro.4dm +++ b/Project/Sources/Methods/test_macro.4dm @@ -7,8 +7,8 @@ GET MACRO PARAMETER:C997(Full method text:K5:17; $fullMethod) var $highlighted GET MACRO PARAMETER:C997(Highlighted method text:K5:18; $highlighted) -var $withSelection : Boolean:=Length:C16($highlighted)>0 - +var $withSelection : Boolean +$withSelection:=Length:C16($highlighted)>0 // YOUR CODE HERE