So hi everyone,
first of all i worked through the first chapter of the progress tutorial and wanted to test my skills so i wanted to create a simple calculator that adds und subtracts 2 integer.
Now i got some weird behaviour i can't explain myself. I will try not to post all my code hopefully it is sufficient to get help. First the definitions:
I don't think i need to post the Button defines since they are not the problem. Now the related frame
The display and enable stuff
I skipped the text defines since they are simply just labels. So my first issue: Is there any possibillity to make the reading of firstArg/secondArg and the writing of addResult easier than that?
cSum is the Button for adding the two integers. The second problem, if i do as postet above the addResult:Screenvalue does not only appear in the fill-in Field , it also appears above the fill-in field. Third, as you see in the framedefinition above i use a rectangle with a 1 char edge. Bug the bound is not compelte, at the spot where the addResult-field is located there is a white cut. If i remove the trigger above the Border is continious with no flaws.
And fourth, i need to click the cSum button twice to get the results shown, is that a correct behaviour?
I hope i could made the problems clear since english isn't my native language.
greetings
first of all i worked through the first chapter of the progress tutorial and wanted to test my skills so i wanted to create a simple calculator that adds und subtracts 2 integer.
Now i got some weird behaviour i can't explain myself. I will try not to post all my code hopefully it is sufficient to get help. First the definitions:
Code:
DEFINE VARIABLE firstArg AS INTEGER INITIAL 0.
DEFINE VARIABLE secondArg AS INTEGER INITIAL 0.
DEFINE VARIABLE addResult AS INTEGER INITIAL 0.
Code:
DEFINE FRAME frame1
BackRect AT ROW 1 COLUMN 1
firstArg AT ROW 3 COLUMN 2
secondArg AT ROW 3 COLUMN 20
addResult AT ROW 3 COLUMN 40
firstTextArg AT ROW 2 COLUMN 2
secondTextArg AT ROW 2 COlUMN 20
resultText AT ROW 2 COLUMN 40
WITH NO-BOX.
Code:
DISPLAY firstArg NO-LABEL secondArg NO-LABEL addResult NO-LABEL
firstTextArg NO-LABEL secondTextArg NO-LABEL resultText NO-LABEL WITH FRAME frame1.
ENABLE firstArg secondArg addResult WITH FRAME frame1.
Code:
ON CHOOSE OF cSUM
DO:
DO WITH FRAME frame1:
ASSIGN addResult:SCREEN-VALUE =
String(INTEGER(firstArg:SCREEN-VALUE) +
INTEGER(secondArg:Screen-Value)).
DISPLAY addResult:SCREEN-VALUE.
END.
END.
And fourth, i need to click the cSum button twice to get the results shown, is that a correct behaviour?
I hope i could made the problems clear since english isn't my native language.
greetings