This forum is dedicated to those who want support programming in ugBASIC.
Questo forum è dedicato a chi desidera supporto per programmare in ugBASIC.
Ce forum est dédié à ceux qui souhaitent prendre en charge la programmation en ugBASIC.
Is there a better way to simplify procedure calls?
As in the example below is use 2 commands to get the result.
Is there a way to do accomplish something like this?
sTART:
CLS
RANDOMIZE TIMER
PROCEDURE rollDice[diceStr$]
{some code to parse and create a total}
RETURN total
END PROC
INPUT "ENTER DICE TO ROLL. EXAMPLE 3D6 ",dice$
rollDice[dice$]
results=PARAM(rollDice)
PRINT "RESULT = ";results
PRINT
PRINT "PRESS ANY KEY TO ROLL AGAIN"
WAIT KEY RELEASE
GOTO sTART
On p. 113 of the manual I saw "If the procedure returns a value, the calling statement just ignore it." and just assumed you had to go the PARAM route.