Skip to content

Commit cf0b172

Browse files
committed
cleanup
1 parent 3ccc1a8 commit cf0b172

2 files changed

Lines changed: 16 additions & 21 deletions

File tree

Project/Sources/Classes/_modernize.4dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Class constructor
88
// Replace declaration lines using the old “(_o_)C_xxx(...)” syntax with the new one “var ... : type”.
99
Function C_2var() : Boolean
1010

11-
var $pattern : Text:="(?-msi)(?<!//)(?<!//\\s){C_}\\((?![\\w\\s]+;\\s*\\$\\{?\\d+\\}?)([^{\\)]*)\\)"
12-
var $code : Text:=This:C1470.fullMethodText
11+
var $pattern:="(?-msi)(?<!//)(?<!//\\s){C_}\\((?![\\w\\s]+;\\s*\\$\\{?\\d+\\}?)([^{\\)]*)\\)"
12+
var $code:=This:C1470.fullMethodText
1313

1414
This:C1470.rgx.setTarget($code)
1515

Project/Sources/Classes/macros.4dm

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
property title : Text
2-
property rgx : cs:C1710._regex
3-
property caret : Text
1+
property title:=Get window title:C450(Frontmost window:C447)
2+
3+
// 📦 Delegates
4+
property rgx:=cs:C1710._regex.new()
5+
6+
//⚠️ Make a concatenation to prevent 4D from interpreting the ‘caret’ tag in this code
7+
property caret:="<caret/"+">"
48

59
property _highlighted : Boolean
610

711
Class constructor()
812

9-
This:C1470.title:=Get window title:C450(Frontmost window:C447)
10-
11-
// 📦 Delegates
12-
This:C1470.rgx:=cs:C1710._regex.new()
13-
1413
var $t : Text
1514
GET MACRO PARAMETER:C997(Highlighted method text:K5:18; $t)
1615
This:C1470._highlighted:=Length:C16($t)>0
1716

18-
//⚠️ Make a concatenation to prevent 4D from interpreting the ‘caret’ tag in this code
19-
This:C1470.caret:="<caret/"+">"
2017

2118
// MARK:- [IN/OUT]
2219
// <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <==
@@ -139,9 +136,7 @@ Function tokenise()
139136

140137
For ($process; 1; Count tasks:C335; 1)
141138

142-
Try(_O_PROCESS PROPERTIES:C336($process; $name; $state; $time; $mode; $UID; $origin))
143-
144-
If ($origin=Design process:K36:9)
139+
If (Process info:C1843($process).type=Design process:K36:9)
145140

146141
POST EVENT:C467(Key down event:K17:4; Enter:K15:35; Tickcount:C458; 0; 0; 0; $process)
147142

@@ -157,23 +152,23 @@ If not, suggest to create it.
157152
*/
158153
Function test_macro() : Boolean
159154

160-
var $t : Text:="test_macro"
155+
var $method:="test_macro"
161156

162157
ARRAY TEXT:C222($_t; 0)
163-
METHOD GET NAMES:C1166($_t; $t; *)
158+
METHOD GET NAMES:C1166($_t; $method; *)
164159

165160
If (Size of array:C274($_t)>0)
166161

167-
return Formula from string:C1601($t; sk execute in host database:K88:5).call()
162+
return Formula from string:C1601($method; sk execute in host database:K88:5).call()
168163

169164
Else
170165

171-
CONFIRM:C162("The \""+$t+"\" method doesn't exist.\r\rWould you like to create it?")
166+
CONFIRM:C162("The \""+$method+"\" method doesn't exist.\r\rWould you like to create it?")
172167

173168
If (Bool:C1537(OK))
174169

175-
METHOD SET CODE:C1194($t; File:C1566("/RESOURCES/test_macro.4dm").getText(); *)
176-
METHOD OPEN PATH:C1213($t; 12; *)
170+
METHOD SET CODE:C1194($method; File:C1566("/RESOURCES/test_macro.4dm").getText(); *)
171+
METHOD OPEN PATH:C1213($method; 12; *)
177172

178173
return True:C214
179174

0 commit comments

Comments
 (0)