Skip to content

Commit

Permalink
Fix redeclaration of variables
Browse files Browse the repository at this point in the history
  • Loading branch information
e-marchand committed Sep 13, 2023
1 parent 6d67d82 commit 9ec8f60
Show file tree
Hide file tree
Showing 40 changed files with 61 additions and 136 deletions.
8 changes: 4 additions & 4 deletions Project/Sources/Classes/ACTIONS_PARAMS.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ Function parameterListManager() : Integer
Function predictingManager($e : Object)

var $height : Integer
var $content; $e : Object
var $content : Object
var $me : cs:C1710.subform

$e:=$e || FORM Event:C1606
Expand Down Expand Up @@ -2000,9 +2000,9 @@ Function dataSourceMenuManager()
Function editList()

/*
$form:=New object(\
"static"; $static; \
"host"; This.path.hostInputControls(True))
$form:=New object(\
"static"; $static; \
"host"; This.path.hostInputControls(True))
$form.folder:=This.path.hostInputControls()
$manifest:=$form.folder.file("manifest.json")
Expand Down
5 changes: 0 additions & 5 deletions Project/Sources/Classes/EDITOR.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,6 @@ Function messageContainer($e : Object)
//______________________________________________________
: ($e.code<0) // <SUBFORM EVENTS>

var $data; $display : Object

$data:=This:C1470.message.getValue()
$display:=$data

Expand All @@ -700,9 +698,6 @@ Function messageContainer($e : Object)
//…………………………………………………………………………………………………
: ($e.code=-8858) // Resize

var $offset : Integer
var $coordinates; $display : Object

$coordinates:=This:C1470.message.getCoordinates()
$coordinates.bottom:=$coordinates.bottom+$display.offset

Expand Down
8 changes: 2 additions & 6 deletions Project/Sources/Classes/FIELDS.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,9 @@ Function updateFieldList
// Gets the list of fields/reports according to the selected table as collections
Function getFieldList()->$result : Object

var $key; $subKey; $tableID : Text
var $key; $subKey; $subKey2; $tableID : Text
var $target : Collection
var $field; $subfield : cs:C1710.field
var $field; $subfield; $subfield2 : cs:C1710.field
var $table : cs:C1710.table
var $formatters : 4D:C1709.Folder

Expand Down Expand Up @@ -592,7 +592,6 @@ Function getFieldList()->$result : Object
//______________________________________________________
: ($subfield.kind="relatedEntity")

var $subKey2 : Text
For each ($subKey2; $field)

If (Value type:C1509($subfield[$subKey2])#Is object:K8:27)
Expand All @@ -601,7 +600,6 @@ Function getFieldList()->$result : Object

End if

var $subfield2 : cs:C1710.field
$subfield2:=$subfield[$subKey2]

Case of
Expand Down Expand Up @@ -751,7 +749,6 @@ Function getFieldList()->$result : Object
//______________________________________________________
: ($subfield.kind="relatedEntity")

var $subKey2 : Text
For each ($subKey2; $subfield)

If (Value type:C1509($subfield[$subKey2])#Is object:K8:27)
Expand All @@ -760,7 +757,6 @@ Function getFieldList()->$result : Object

End if

var $subfield2 : cs:C1710.field
$subfield2:=$subfield[$subKey2]

Case of
Expand Down
9 changes: 3 additions & 6 deletions Project/Sources/Classes/MAIN.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ Function handleEvents($e : Object) : Integer

Else // <== WIDGETS METHOD

var $x : Blob
var $o : Object

Case of

//==============================================
// MARK: _dataModel
: (This:C1470._dataModel.catch())

var $x : Blob
var $o : Object

//$o:=This._dataModel.cellPosition($e)

Case of
Expand Down Expand Up @@ -122,9 +122,6 @@ Function handleEvents($e : Object) : Integer
// MARK: displayed
: (This:C1470.displayed.catch())

var $x : Blob
var $o : Object

//$o:=This.displayed.cellPosition($e)

Case of
Expand Down
1 change: 0 additions & 1 deletion Project/Sources/Classes/MobileProjectAndroid.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,6 @@ a Java package name, such as com.example.myapp.

This:C1470.isOnError:=False:C215

var $t : Text
For each ($t; Split string:C1554(This:C1470.project.package; ".")) While (Not:C34(This:C1470.isOnError))

If (Match regex:C1019("^[\\._0-9]"; $t; 1))
Expand Down
24 changes: 7 additions & 17 deletions Project/Sources/Classes/Storyboard.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ If (Length($Txt_out)>0)
var $File_ : Object
$File_:=Folder(Temporary folder; fk platform path).file(Generate UUID+"ibtool.plist")
$File_.setText($Txt_out)
$Obj_out:=_o_plist(New object(\
"action"; "object"; \
"domain"; $File_.path))
$Obj_out:=_o_plist(New object(\
"action"; "object"; \
"domain"; $File_.path))
$File_.delete()
If (($Obj_out.success)\
& ($Obj_out.value#Null))
If (($Obj_out.success)\
& ($Obj_out.value#Null))
$Obj_out.version:=String($Obj_out.value["com.apple.ibtool.version"]["bundle-version"])
Expand Down Expand Up @@ -324,7 +324,7 @@ Function colorAssetFix($theme : Object)->$Obj_out : Object
// write if there is one named colors (could also do it only if one attribute change)

//_o_doc_UNLOCK_DIRECTORY(New object(\
"path"; $File_.parent.platformPath))
"path"; $File_.parent.platformPath))

cs:C1710.lep.new().unlockDirectory($File_.parent)

Expand Down Expand Up @@ -639,15 +639,7 @@ Function injectElement
End for each


Function xmlAppendRelationAttributeForField()->$response : Object
C_LONGINT:C283($Lon_j; $1)
$Lon_j:=$1
C_OBJECT:C1216($Dom_root; $2)
$Dom_root:=$2
C_BOOLEAN:C305($IsToMany; $3)
$IsToMany:=$3
C_OBJECT:C1216($Dom_; $0)

Function xmlAppendRelationAttributeForField($Lon_j : Integer; $Dom_root : Object; $IsToMany : Boolean)->$Dom_ : Object

// find the element $Lon_j by looking at userDefinedRuntimeAttribute
$Dom_:=$Dom_root.findByXPath("//*/userDefinedRuntimeAttribute[@keyPath='bindTo.record.___FIELD_"+String:C10($Lon_j)+"___']") // or value="___FIELD_1_BINDING_TYPE___"
Expand Down Expand Up @@ -679,8 +671,6 @@ Function xmlAppendRelationAttributeForField()->$response : Object

End if

$0:=$Dom_

Function injectSegue
C_LONGINT:C283($Lon_j; $1)
$Lon_j:=$1
Expand Down
2 changes: 1 addition & 1 deletion Project/Sources/Classes/VIEWS.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ Function setTemplate($browser : Object)

var $currentTemplate; $newTemplate; $selector; $tableID; $url : Text
var $update : Boolean
var $browser; $context; $o; $target : Object
var $context; $o; $target : Object
var $c : Collection
var $template : cs:C1710.tmpl

Expand Down
10 changes: 3 additions & 7 deletions Project/Sources/Classes/_O_MAIN.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,13 @@ Function handleEvents($e : Object) : Integer

Else // <== WIDGETS METHOD

var $x : Blob
var $o : Object
Case of

//==============================================
: (This:C1470._dataModel.catch())

var $x : Blob
var $o : Object

//$o:=This._dataModel.cellPosition($e)

Case of
Expand Down Expand Up @@ -129,9 +128,6 @@ Function handleEvents($e : Object) : Integer
//==============================================
: (This:C1470.displayed.catch())

var $x : Blob
var $o : Object

//$o:=This.displayed.cellPosition($e)

Case of
Expand Down Expand Up @@ -409,7 +405,7 @@ Function mainHandleEvents($e : Object)->$allow : Integer
// End if
// Else
//If ($o.src#$e.row)\
& ($e.row#($o.src+1)) // Not the same or the next one
& ($e.row#($o.src+1)) // Not the same or the next one
//$o:=$me.rowCoordinates($e.row)
//$o.bottom:=$o.top
//$o.right:=$me.coordinates.right
Expand Down
20 changes: 9 additions & 11 deletions Project/Sources/Classes/adb.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -821,43 +821,41 @@ Function waitStartApp
// Else : all ok
End if

Function uninstallAppIfInstalled($package : Text; $serial : Text)
Function uninstallAppIfInstalled($package : Text; $serial : Text)->$result : Object



var $0 : Object
var $1 : Text // emulator serial
var $2 : Text // package name (app name)
var $Obj_isInstalled; $Obj_uninstall : Object

$0:=New object:C1471(\
$result:=New object:C1471(\
"success"; False:C215; \
"errors"; New collection:C1472)

$Obj_isInstalled:=This:C1470.isAppAlreadyInstalled($1; $2)
$Obj_isInstalled:=This:C1470.isAppAlreadyInstalled($package; $serial)

If ($Obj_isInstalled.success)

If ($Obj_isInstalled.isInstalled)

$Obj_uninstall:=This:C1470.waitUninstallApp($1; $2)
$Obj_uninstall:=This:C1470.waitUninstallApp($package; $serial)

If ($Obj_uninstall.success)

$0.success:=True:C214
$result.success:=True:C214

Else

$0.errors:=$Obj_uninstall.errors
$result.errors:=$Obj_uninstall.errors

End if

Else
// App not installed
$0.success:=True:C214
$result.success:=True:C214
End if

Else
$0.errors:=$Obj_isInstalled.errors
$result.errors:=$Obj_isInstalled.errors
End if

Function waitForDevicePackageList
Expand Down
1 change: 0 additions & 1 deletion Project/Sources/Classes/bmp.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ Function getHeader()->$header : Object

// INT16 Reserved Field(1)
// INT16 Reserved Field(2)
var $offset : Integer
$offset:=0x000A

// UINT32 Starting Position of Image Data (offset in bytes)
Expand Down
3 changes: 1 addition & 2 deletions Project/Sources/Classes/formatter.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ Function create($type : Variant; $data : Collection)->$file : 4D:C1709.File
"$comment"; "Map database values to some display values using choiceList"; \
"binding"; "localizedText")
var $datum : Variant
$manifest.choiceList:=This:C1470.defaultChoiceList($typeString; True:C214)
Case of
: (($typeString="bool") | ($typeString="boolean"))
Expand All @@ -257,7 +258,6 @@ Function create($type : Variant; $data : Collection)->$file : 4D:C1709.File
: (($typeString="number") | ($typeString="integer") | ($typeString="real"))
If (Count parameters:C259>1)
$manifest.choiceList:=New object:C1471()
var $datum : Variant
For each ($datum; $data)
$manifest.choiceList[String:C10($datum)]:=String:C10($datum)
End for each
Expand All @@ -267,7 +267,6 @@ Function create($type : Variant; $data : Collection)->$file : 4D:C1709.File
: (($typeString="string") | ($typeString="text"))
If (Count parameters:C259>1)
$manifest.choiceList:=New object:C1471()
var $datum : Variant
For each ($datum; $data)
$manifest.choiceList[String:C10($datum)]:=String:C10($datum)
End for each
Expand Down
2 changes: 0 additions & 2 deletions Project/Sources/Classes/project.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ Function fields($table : Variant) : Collection
Function storageFields($table : Variant)->$fields : Collection

var $model : Object
var $fields : Collection

Case of

Expand Down Expand Up @@ -2594,7 +2593,6 @@ Function repairStructure($audit : Collection)
//======================================
: ($relatedField.kind="relatedEntity")

var $linkedItem : Object
For each ($linkedItem; This:C1470.storageFields($relatedField))

$field:=$table.query("fieldNumber = :1"; Num:C11($linkedItem.key)).pop()
Expand Down
1 change: 0 additions & 1 deletion Project/Sources/Classes/studio.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ Function isDefaultPath()->$isDefault : Boolean
Function paths()->$instances : Collection

var $t : Text
var $instances : Collection
var $file : 4D:C1709.File

Case of
Expand Down
1 change: 0 additions & 1 deletion Project/Sources/Classes/xcDataModel.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,6 @@ Function _relation($table : Object; $options : Object)->$out : Object

If ($Obj_buffer.success)

var $Obj_field : Object
For each ($Obj_field; $Obj_buffer.fields) // CLEAN must only have one

// Create the inverse field
Expand Down
3 changes: 1 addition & 2 deletions Project/Sources/Methods/00_TESTS.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var $null : Variant
var $file; $folder; $o; $o1; $o2; $Obj_formula; $Obj_new; $result; $Obj_target; $Obj_template : Object
var $zip : Object
var $c; $c1; $Col_2; $cUserdCommands : Collection
var $error : cs:C1710.error

ARRAY TEXT:C222($tTxt_; 0)

Expand Down Expand Up @@ -65,7 +66,6 @@ Case of
: (True:C214)

var $status : Object
var $error : cs:C1710.error
var $web : 4D:C1709.WebServer

Check warning on line 69 in Project/Sources/Methods/00_TESTS.4dm

View workflow job for this annotation

GitHub Actions / Build

The class WebServer is unknown. (550.4)

Check warning on line 69 in Project/Sources/Methods/00_TESTS.4dm

View workflow job for this annotation

GitHub Actions / Build

The class WebServer is unknown. (550.4)

$web:=WEB Server:C1674(Web server host database:K73:31)
Expand Down Expand Up @@ -210,7 +210,6 @@ Case of
//________________________________________
: (True:C214)

var $error : cs:C1710.error
$error:=cs:C1710.error.new("capture")

Formula from string:C1601("$b:=true").call()
Expand Down
1 change: 0 additions & 1 deletion Project/Sources/Methods/Process_tags.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ If ($Col_types.indexOf("___TABLE___")#-1) // ___TABLE___.* or file part
$Obj_tags.listFormType\
))

C_VARIANT:C1683($Var_field)
For each ($Var_field; $Obj_table.fields)

If (Value type:C1509($Var_field)=Is object:K8:27) // No real #114338
Expand Down
2 changes: 0 additions & 2 deletions Project/Sources/Methods/Process_tags_on_file.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

C_BLOB:C604($x)
C_TEXT:C284($Txt_content)
C_OBJECT:C1216($Obj_tags)
C_COLLECTION:C1488($Col_types)

If (False:C215)
C_VARIANT:C1683(Process_tags_on_file; $1)
Expand Down
2 changes: 1 addition & 1 deletion Project/Sources/Methods/Rest.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ End if
var $query; $queryValue : Text
var $caller; $i; $port; $timeout : Integer
var $x : Blob
var $in; $out; $requestResult; $webServerInfos : Object
var $requestResult; $webServerInfos : Object
var $requestResultAsBlob : Blob
var $requestResultAsText : Text
var $error : cs:C1710.error
Expand Down

0 comments on commit 9ec8f60

Please sign in to comment.