Changeset 2275 in Sophya for trunk/SophyaPI/PIext


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

Location:
trunk/SophyaPI/PIext
Files:
2 edited

Legend:

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

    r2268 r2275  
    570570  if (tokens.size() < 2) {
    571571    cout << "Usage: vecplot nameVecX nameVecY [opt]" << endl;
     572    return(0);
    572573  }
    573574  while (tokens.size() < 3) tokens.push_back("");
  • 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.