Fixed
Pinned fields
Click on the next to a field label to start pinning.
Details
Components
Assignee
Jamie NossJamie NossReporter
Dan CamperDan CamperPriority
Minor
Details
Details
Components
Assignee
Jamie Noss
Jamie NossReporter
Dan Camper
Dan CamperPriority
Created August 11, 2015 at 2:24 PM
Updated January 15, 2016 at 3:13 PM
Resolved September 4, 2015 at 11:26 AM
Given the following made-up, working example:
DataRec := RECORD UNSIGNED1 x; UNSIGNED1 y; UNSIGNED1 z := 0; END; ds := DATASET ( [ {12, 14}, {22, 24}, {32, 34} ], DataRec ); MaybeAdd(inFile, destField, field1 = '', field2 = '') := FUNCTIONMACRO LOCAL result := PROJECT ( inFile, TRANSFORM ( RECORDOF(inFile), SELF.destField := #IF(#TEXT(field1) != '') LEFT.field1 #ELSE 0 #END + #IF(#TEXT(field2) != '') LEFT.field2 #ELSE 0 #END , SELF := LEFT ) ); RETURN result; ENDMACRO; res := MaybeAdd ( ds, z, field1 := x, field2 := y ); res;
The problem pops up in the call to MaybeAdd() if you comment out the field1 argument:
// field1 := x,
or
/* field1 := x, */
If you comment that line out and syntax-check the code, you get this error:
Error: Object 'LEFT' does not have a field named 'field2' (26, 3), 2171,
Only removing the argument entirely works.