0

unrecognized command do is occurring when i am trying to use below code in mapbasic window. can anyone help me how to fix it although syntaz is correct

fetch first from t1
Do while Not EOT(t1) 
 'Do this with table t1 
 fetch Next from t1 
Loop
T_Bacon
2,20312 silver badges16 bronze badges
asked Jul 24, 2017 at 7:14
3
  • The syntax looks ok, have you got any other code running before this? Is t1 a table name, string variable or alias variable? Commented Jul 24, 2017 at 8:29
  • yes i am printing table t1 row count its printing fine but when i use any loop like for next, do while its giving error unrecognized command Commented Jul 24, 2017 at 11:15
  • Welcome to GIS SE! As a new user be sure to take the Tour to learn about our focussed Q&A format. You appear to have created two accounts which inevitably leads to a frustrating experience for you, potential answerers and reviewers so please follow these instructions ASAP to merge your accounts. Commented Jul 24, 2017 at 11:19

1 Answer 1

1

You can't use loops in the MapBasic Window. You need to download the stand-alone Mapbasic program and compile your code into an application.

For simple code you should be able to migrate from the MapBasic Window to MapBasic Application with very few, if any, changes, so it shouldn't be too daunting.

answered Jul 24, 2017 at 11:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.