[Smipl-devel] SF.net SVN: smipl:[45] smipl-devel/src
Brought to you by:
the_student
From: <the...@us...> - 2009-08-29 08:29:18
|
Revision: 45 http://smipl.svn.sourceforge.net/smipl/?rev=45&view=rev Author: the_student Date: 2009-08-29 08:29:05 +0000 (Sat, 29 Aug 2009) Log Message: ----------- Tried fixing bug Modified Paths: -------------- smipl-devel/src/Console.h smipl-devel/src/SVM.h Modified: smipl-devel/src/Console.h =================================================================== --- smipl-devel/src/Console.h 2009-08-28 20:26:40 UTC (rev 44) +++ smipl-devel/src/Console.h 2009-08-29 08:29:05 UTC (rev 45) @@ -4,10 +4,9 @@ if(!using_library)cin.getline(a,length); else {script_file->getline(a,length);if(script_file->eof()){using_script=false;delete script_file;}} } -int a=0; bool Console(int argc, char** argv) { SMIPL_String cmd; - int Lib_start; + int Lib_start,a; char *str, *str2; try{ sys_clearscreen(); @@ -18,6 +17,7 @@ cout<<"? "; getstr(cmd.str, 80); cmd.Split(); + for(a=0;a<cmd.argc;a++) cout<<a<<":"<<cmd.argv[a]<<endl; if(cmd_is("")) continue; if(cmd_is("QUIT")) break; if(cmd_is("EXIT")) break; Modified: smipl-devel/src/SVM.h =================================================================== --- smipl-devel/src/SVM.h 2009-08-28 20:26:40 UTC (rev 44) +++ smipl-devel/src/SVM.h 2009-08-29 08:29:05 UTC (rev 45) @@ -9,6 +9,7 @@ SMIPL_String cmd; value_t number,number2; MIDI_Message MIDI_Melding; + int a; void MDS_Get(char* Name, value_t* value) { pthread_mutex_lock(&Admin); @@ -77,14 +78,14 @@ //Flow control if(cmd_is("GOTO")) {if(cmd.argc>=2) {Atof(cmd.argv[1],&number);Address=number-1;}continue;} //Set - if(cmd_is("SET")) {for(int a=1;a<cmd.argc;a+=2) {Atof(cmd.argv[a+1],&number);MDS_Set(cmd.argv[a], number);}continue;} + if(cmd_is("SET")) {for(a=1;a<=cmd.argc;a+=2) {Atof(cmd.argv[a+1],&number);MDS_Set(cmd.argv[a], number);cout<<":";}continue;} //Basic Arithmetic - if(cmd_is("ADD")) {Atof(cmd.argv[1],&number);for(int a=2;a<cmd.argc;a++){Atof(cmd.argv[a], &number2);number+=number2;}MDS_Set(cmd.argv[1], number);continue;} - if(cmd_is("SUBRACT")) {Atof(cmd.argv[1],&number);for(int a=2;a<cmd.argc;a++){Atof(cmd.argv[a], &number2);number-=number2;}MDS_Set(cmd.argv[1], number);continue;} - if(cmd_is("MULTIPLY")) {Atof(cmd.argv[1],&number);for(int a=2;a<cmd.argc;a++){Atof(cmd.argv[a], &number2);number*=number2;}MDS_Set(cmd.argv[1], number);continue;} - if(cmd_is("DIVIDE")) {Atof(cmd.argv[1],&number);for(int a=2;a<cmd.argc;a++){Atof(cmd.argv[a], &number2);number/=number2;}MDS_Set(cmd.argv[1], number);continue;} + if(cmd_is("ADD")) {Atof(cmd.argv[1],&number);for(a=2;a<cmd.argc;a++){Atof(cmd.argv[a], &number2);number+=number2;}MDS_Set(cmd.argv[1], number);continue;} + if(cmd_is("SUBRACT")) {Atof(cmd.argv[1],&number);for(a=2;a<cmd.argc;a++){Atof(cmd.argv[a], &number2);number-=number2;}MDS_Set(cmd.argv[1], number);continue;} + if(cmd_is("MULTIPLY")) {Atof(cmd.argv[1],&number);for(a=2;a<cmd.argc;a++){Atof(cmd.argv[a], &number2);number*=number2;}MDS_Set(cmd.argv[1], number);continue;} + if(cmd_is("DIVIDE")) {Atof(cmd.argv[1],&number);for(a=2;a<cmd.argc;a++){Atof(cmd.argv[a], &number2);number/=number2;}MDS_Set(cmd.argv[1], number);continue;} //IO - if(cmd_is("PRINT")) {for(int a=1;a<cmd.argc;a++) {Atof(cmd.argv[a], &number);cout<<cmd.argv[a]<<" = "<<number<<" ";}cout<<endl;continue;} + if(cmd_is("PRINT")) {for(a=1;a<cmd.argc;a++) {Atof(cmd.argv[a], &number);cout<<cmd.argv[a]<<" = "<<number<<" ";}cout<<endl;continue;} if(cmd_is("NEWLINE")){cout<<endl;continue;} //MIDI if(cmd_is("MIDI")) { @@ -102,7 +103,7 @@ Atof(cmd.argv[0],&number); if(number!=0) { Push(Address); - for(int a=1;a<cmd.argc;a++){Atof(cmd.argv[a],&number2);Push(number2);} + for(a=1;a<cmd.argc;a++){Atof(cmd.argv[a],&number2);Push(number2);} Push(cmd.argc-1); Address=(int)number-1; continue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |