Get Values From Terminal - Propeller C - Start Simple
AngryPickle
Posts: 2
in Propeller 1
Hi
Need some assistance with one of the parallax tutorials.
I'm trying to replace scan and print functions with get and put functions, respectively.
The code below does not build, can somebody explain why and how to replace the sections of code that require the scan function with get commands. (I have marked the troubling code sections with "***" below).
Thanks
Code is below this line
#include "simpletools.h" // Include simple tools
int startVal;
int endVal;
int main() // Main function
{
putStr("Type values for startVal and \n");
putStr("endVal, separated by a space. \n");
putStr("Then, press Enter. \n");
getDec("%d%d", startVal);***
getDec("%d%d", endVal);***
putStr("\nCounting from ");
putDec(startVal);
putStr(" to ");
putDec(endVal);
putStr(".\n");
for(int n = startVal; n <= endVal; n++)
{
print("i = %d\n", n);***
}
putStr("\nDone!");
}
Need some assistance with one of the parallax tutorials.
I'm trying to replace scan and print functions with get and put functions, respectively.
The code below does not build, can somebody explain why and how to replace the sections of code that require the scan function with get commands. (I have marked the troubling code sections with "***" below).
Thanks
Code is below this line
#include "simpletools.h" // Include simple tools
int startVal;
int endVal;
int main() // Main function
{
putStr("Type values for startVal and \n");
putStr("endVal, separated by a space. \n");
putStr("Then, press Enter. \n");
getDec("%d%d", startVal);***
getDec("%d%d", endVal);***
putStr("\nCounting from ");
putDec(startVal);
putStr(" to ");
putDec(endVal);
putStr(".\n");
for(int n = startVal; n <= endVal; n++)
{
print("i = %d\n", n);***
}
putStr("\nDone!");
}
Comments
Mike