407{
409
410 if(command == macroPathCommand)
411 {
414 }
415 if(command == ExecuteCommand)
416 {
420 {
424 }
425 }
426 if(command == suppressAbortionCommand)
427 {
430 }
431 if(command == verboseCommand)
432 {
434 }
435 if(command == doublePrecCommand)
436 {
439 }
440 if(command == historyCommand)
441 {
443 }
444 if(command == stopStoreHistoryCommand)
445 {
447 }
448 if(command == ManualCommand)
449 {
451 }
452 if(command == aliasCommand)
453 {
455 }
456 if(command == unaliasCommand)
457 {
459 }
460 if(command == listAliasCommand)
461 {
463 }
464 if(command == getEnvCmd)
465 {
467 if(std::getenv(newValue))
468 {
470 st += " ";
471 st += std::getenv(newValue);
473 }
474 else
475 {
477 ed << "<" << newValue
478 << "> is not defined as a shell variable. Command ignored.";
480 }
481 }
482 if(command == getValCmd)
483 {
489 {
493 {
496 for(
G4int i = 0; i <= idx; i++)
497 {
498 theValue = nextVal();
499 }
500 }
502 st += aliName + " " + theValue;
504 }
505 }
506 if(command == echoCmd)
507 {
509 }
510 if(command == shellCommand)
511 {
513 int rc = system(newValue);
514 if(rc < 0)
515 {
517 ed << "<" << newValue
518 << "> is not a valid shell command. Command ignored.";
520 }
521 }
522 if(command == loopCommand)
523 {
527 {
531 }
532 }
533 if(command == foreachCommand)
534 {
538 {
542 }
543 }
544 if(command == HTMLCommand)
545 {
547 }
548 if(command == maxStoredHistCommand)
549 {
551 }
552 if(command == ifCommand)
553 {
560 if(comp == ">")
561 x = (l > r);
562 else if(comp == ">=")
563 x = (l >= r);
564 else if(comp == "<")
565 x = (l < r);
566 else if(comp == "<=")
567 x = (l <= r);
568 else if(comp == "==")
569 x = (l == r);
570 else if(comp == "!=")
571 x = (l != r);
572 if(x)
574 }
575 if(command == doifCommand)
576 {
581
584 while(!((ca = next()).isNull()))
585 {
586 c1 += " ";
587 c1 += ca;
588 }
589 if(c1(0) == '"')
590 {
592 if(c1(c1.length() - 1) == '"')
593 {
594 strippedValue = c1(1, c1.length() - 2);
595 }
596 else
597 {
598 strippedValue = c1(1, c1.length() - 1);
599 }
600 c1 = strippedValue;
601 }
602
604 if(comp == ">")
605 x = (l > r);
606 else if(comp == ">=")
607 x = (l >= r);
608 else if(comp == "<")
609 x = (l < r);
610 else if(comp == "<=")
611 x = (l <= r);
612 else if(comp == "==")
613 x = (l == r);
614 else if(comp == "!=")
615 x = (l != r);
616 if(x)
618 }
619 if(command == addCommand)
620 {
626 st += newA;
627 st += " ";
630 }
631 if(command == subtractCommand)
632 {
638 st += newA;
639 st += " ";
642 }
643 if(command == multiplyCommand)
644 {
650 st += newA;
651 st += " ";
654 }
655 if(command == divideCommand)
656 {
662 st += newA;
663 st += " ";
666 }
667 if(command == remainderCommand)
668 {
674 st += newA;
675 st += " ";
678 }
679 if(command == strifCommand)
680 {
687 if(comp == "==")
688 {
689 x = (l == r);
690 }
691 else if(comp == "!=")
692 {
693 x = (l != r);
694 }
695 if(x)
697 }
698 if(command == strdoifCommand)
699 {
704
707 while(!((ca = next()).isNull()))
708 {
709 c1 += " ";
710 c1 += ca;
711 }
712 if(c1(0) == '"')
713 {
715 if(c1(c1.length() - 1) == '"')
716 {
717 strippedValue = c1(1, c1.length() - 2);
718 }
719 else
720 {
721 strippedValue = c1(1, c1.length() - 1);
722 }
723 c1 = strippedValue;
724 }
725
727 if(comp == "==")
728 {
729 x = (l == r);
730 }
731 else if(comp == "!=")
732 {
733 x = (l != r);
734 }
735 if(x)
737 }
738 if(command == ifBatchCommand)
739 {
742 }
743 if(command == ifInteractiveCommand)
744 {
747 }
748 if(command == doifBatchCommand)
749 {
752 }
753 if(command == doifInteractiveCommand)
754 {
757 }
758}
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
void SetSuppressAbortion(G4int i)
static G4bool GetNewBoolValue(const char *paramString)
static G4int GetNewIntValue(const char *paramString)
void CommandFailed(G4int errCode, G4ExceptionDescription &ed)
static void UseDoublePrecisionStr(G4bool val)
void ForeachS(const char *valueList)
G4int ApplyCommand(const char *aCommand)
void CreateHTML(const char *dir="/")
void LoopS(const char *valueList)
void StoreHistory(const char *fileName="G4history.macro")
void ListCommands(const char *direc)
void ExecuteMacroFile(const char *fileName)
void SetMacroSearchPath(const G4String &path)
void SetMaxHistSize(G4int mx)
G4int GetLastReturnCode() const
G4String GetCurrentValues(const char *aCommand)
void SetAlias(const char *aliasLine)
G4String FindMacroPath(const G4String &fname) const
void RemoveAlias(const char *aliasName)
G4String SolveAlias(const char *aCmd)
void ParseMacroSearchPath()
void SetVerboseLevel(G4int val)
G4String DtoS(G4double a)
G4double StoD(G4String s)