GOSUB .NET
-
i am converting code in basic language from CASIO FX 880P, blindly into vb.net CF... guess what, vb.net doesnt support the GOSUB statement anymore.. many gosub statements in the source code perform recurrsions... if i cud only find the starting end of this noodle.. hmmmm
All Rights Reserved! All Wrongs Revenged!
This forum is not a place to ask for help to a problem, but rather discuss what programming horror you have run across and how you fixed it/avoided it (note the past tense here). Try the programming forums for programming questions/problems :) As far as
gosub
is concerned, you have to take the code that is referenced by the gosub and refactor it into a procedure. Then, call the procedure. Just a bit of code converting ahead for you :)"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
This forum is not a place to ask for help to a problem, but rather discuss what programming horror you have run across and how you fixed it/avoided it (note the past tense here). Try the programming forums for programming questions/problems :) As far as
gosub
is concerned, you have to take the code that is referenced by the gosub and refactor it into a procedure. Then, call the procedure. Just a bit of code converting ahead for you :)"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"whats with men and asking directions?" Finding Nemo.. I am to egoistic to ask for help :) .. i was just sharing one of my worst experiences.. besides how wud you refactor a recurrsion? specially when all the variables are just capital alphabets? IF A>1E99 THEN GOSUB#0 HOW I MANAGED TO WORK AROUND i executed the code on the calculator (Since i am not aware of any simulator for fx880p), used the STOP button on the calculator (since there are no breakpoints in fx880p) and drew a control flow diagram (estimated).. then i had to copy some lines of code into several sub procedures (cons of noodle programming) most of the times, plucking out independent section of LOCs into a sperate function was easy ... some times it was impossible .. i yet have to test the application but as the the saying goes Testing can be used to prove the presence of errors in a software, but not to prove thier absence... (i think dijkstra said/implied it) P.S. i used PRESENT TENSE bcz i was still working on the same project not bcz i am PRESENTLY TENSE (and thus need help).. :)
All Rights Reserved! All Wrongs Revenged!
-
"whats with men and asking directions?" Finding Nemo.. I am to egoistic to ask for help :) .. i was just sharing one of my worst experiences.. besides how wud you refactor a recurrsion? specially when all the variables are just capital alphabets? IF A>1E99 THEN GOSUB#0 HOW I MANAGED TO WORK AROUND i executed the code on the calculator (Since i am not aware of any simulator for fx880p), used the STOP button on the calculator (since there are no breakpoints in fx880p) and drew a control flow diagram (estimated).. then i had to copy some lines of code into several sub procedures (cons of noodle programming) most of the times, plucking out independent section of LOCs into a sperate function was easy ... some times it was impossible .. i yet have to test the application but as the the saying goes Testing can be used to prove the presence of errors in a software, but not to prove thier absence... (i think dijkstra said/implied it) P.S. i used PRESENT TENSE bcz i was still working on the same project not bcz i am PRESENTLY TENSE (and thus need help).. :)
All Rights Reserved! All Wrongs Revenged!
digitals2002 wrote:
i was just sharing one of my worst experiences..
Okay :-D
digitals2002 wrote:
how wud you refactor a recurrsion?
Very carefully :rolleyes:
digitals2002 wrote:
All Rights Reserved! All Wrongs Revenged!
:laugh: I like that :)
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
"whats with men and asking directions?" Finding Nemo.. I am to egoistic to ask for help :) .. i was just sharing one of my worst experiences.. besides how wud you refactor a recurrsion? specially when all the variables are just capital alphabets? IF A>1E99 THEN GOSUB#0 HOW I MANAGED TO WORK AROUND i executed the code on the calculator (Since i am not aware of any simulator for fx880p), used the STOP button on the calculator (since there are no breakpoints in fx880p) and drew a control flow diagram (estimated).. then i had to copy some lines of code into several sub procedures (cons of noodle programming) most of the times, plucking out independent section of LOCs into a sperate function was easy ... some times it was impossible .. i yet have to test the application but as the the saying goes Testing can be used to prove the presence of errors in a software, but not to prove thier absence... (i think dijkstra said/implied it) P.S. i used PRESENT TENSE bcz i was still working on the same project not bcz i am PRESENTLY TENSE (and thus need help).. :)
All Rights Reserved! All Wrongs Revenged!
So, if you want recursion what is wrong with this:
if( a < fSomeValue ) ThisFunction();
And really, listening to your hardships is painful. Why not rewrite the whole thing instead? Really! The rewrite might take longer, but debugging time would be shorter, and your code would be one helluva lot easier to manage in the future._____________________________________ Action without thought is not action Action without emotion is not life
-
This forum is not a place to ask for help to a problem, but rather discuss what programming horror you have run across and how you fixed it/avoided it (note the past tense here). Try the programming forums for programming questions/problems :) As far as
gosub
is concerned, you have to take the code that is referenced by the gosub and refactor it into a procedure. Then, call the procedure. Just a bit of code converting ahead for you :)"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
Paul Conrad wrote:
This forum is not a place to ask for help to a problem, but rather discuss what programming horror you have run across
If using GOSUB doesn't meet the definition of "coding horror", I don't know what does.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Paul Conrad wrote:
This forum is not a place to ask for help to a problem, but rather discuss what programming horror you have run across
If using GOSUB doesn't meet the definition of "coding horror", I don't know what does.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001John Simmons / outlaw programmer wrote:
If using GOSUB doesn't meet the definition of "coding horror", I don't know what does.
I guess you have the same feelings towards the use of a nice little goto in c/c++ code. This lovely keyword is already one of the most unapreciated keywords in the language :sigh: Surely you can't consider
__asm jmp some_lable;
as coding horror.codito ergo sum
-
John Simmons / outlaw programmer wrote:
If using GOSUB doesn't meet the definition of "coding horror", I don't know what does.
I guess you have the same feelings towards the use of a nice little goto in c/c++ code. This lovely keyword is already one of the most unapreciated keywords in the language :sigh: Surely you can't consider
__asm jmp some_lable;
as coding horror.codito ergo sum
Any assembly language is a coding horror (just like any flavor of VB you might happen to mention). :)
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Any assembly language is a coding horror (just like any flavor of VB you might happen to mention). :)
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001John Simmons / outlaw programmer wrote:
Any assembly language is a coding horror
Awww, come on :->
John Simmons / outlaw programmer wrote:
any flavor of VB you might happen to mention
Yep...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
Paul Conrad wrote:
This forum is not a place to ask for help to a problem, but rather discuss what programming horror you have run across
If using GOSUB doesn't meet the definition of "coding horror", I don't know what does.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001I suppose
ON x GOSUB sub1, sub2, sub3
is worse. -
I suppose
ON x GOSUB sub1, sub2, sub3
is worse.