Changeset 2275 in Sophya for trunk/SophyaPI/PIext/piacmd.cc


Ignore:
Timestamp:
Nov 17, 2002, 7:54:05 PM (23 years ago)
Author:
ansari
Message:

Protection nb arg pour defscript et pour vecplot - Reza 17/11/2002

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/piacmd.cc

    r2274 r2275  
    928928}
    929929else if (kw == "defscript") {  // definition de script
    930   curscript = new PIACmdScript(this, tokens[0], tokens[1]);
    931   mImgApp->GetConsole()->SetPrompt("Script...> ");
    932   return(0);
     930  if (tokens.size() > 0) {
     931    if (tokens.size() < 2)  tokens.push_back("");
     932    curscript = new PIACmdScript(this, tokens[0], tokens[1]);
     933    mImgApp->GetConsole()->SetPrompt("Script...> ");
     934    return(0);
     935  }
     936  else {
     937    cerr << "PIACmd::Interpret() No script name in defscript" << endl;
     938    return(1);
     939  }
    933940}
    934941else {
Note: See TracChangeset for help on using the changeset viewer.