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
  • The syntax looks ok, have you got any other code running before this? Is t1 a table name, string variable or alias variable? – T_Bacon Jul 24 '17 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 – user514348 Jul 24 '17 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. – PolyGeo Jul 24 '17 at 11:19
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.