hexagon logo

Script Not Executing

Hi there,

I copied the below script from the manual and saved it as C:\ENTER_NUM_SCRIPT.BAS If I RUN it in the Basic Script Editor it works as expected.

Sub Main
  Dim Msg, X, Y
  X = InputBox("Enter a Number:")
  Y = Abs(X)
  Msg = "The number you entered is " & X
  Msg = Msg + ". The Absolute value of " & X & " is " & Y
  MsgBox Msg 'Display Message.
End Sub
But if I call it from within a part program with the below, the script does not appear to run at all but the report comment does get printed out.
CS1        =SCRIPT/FILENAME= C:\ENTER_NUM_SCRIPT.BAS
            FUNCTION/Main,SHOW=YES,,
            STARTSCRIPT/
            COMMENT/REPT," I GOT HERE PASSED THE SCRIPT"
This happens with any script I attempt to run from within a part program.. strangely it was working this morning. A PC restart does nothing. Does anyone have a suggestion? Is there a particular place from within a part program I have to call scripts from? Or a setting somewhere?? ...anything at all???

...really confused here Disappointed... michelle
Parents
  • Ok, this probably does not apply to what you are doing at all, but this is what you see when you export a PC-DMIS program as basic. This is an Input comment:

    Set DmisCommand = DmisCommands.Add(SET_COMMENT, TRUE)
        [COLOR="Red"]DmisCommand.Marked = TRUE[/COLOR]
      ' Set Id  = WORKORDER
        retval = DmisCommand.PutText ("WORKORDER", ID, 0)
      ' Set Comment Type  = INPUT
        retval = DmisCommand.SetToggleString (3, COMMENT_TYPE, 0)
      ' Set Comment Item 1 = 'Enter the workorder #,
        retval = DmisCommand.PutText ("'Enter the workorder #,", COMMENT_FIELD, 1)
      ' Set Comment Item 2 = using a period instead of a slash.'
        retval = DmisCommand.PutText ("using a period instead of a slash.'", COMMENT_FIELD, 2)
      ' Set Report  = NO
        retval = DmisCommand.SetToggleString (1, OUTPUT_TYPE, 0)


    What you probably need to look for is a way to mark all dimensions through code before executing the program. Look in the Wilcox script repository and search this site. I know there is a script that does this. So, you'd import your program, run this script, THEN execute the program, and everything would be hunky-dory.
Reply
  • Ok, this probably does not apply to what you are doing at all, but this is what you see when you export a PC-DMIS program as basic. This is an Input comment:

    Set DmisCommand = DmisCommands.Add(SET_COMMENT, TRUE)
        [COLOR="Red"]DmisCommand.Marked = TRUE[/COLOR]
      ' Set Id  = WORKORDER
        retval = DmisCommand.PutText ("WORKORDER", ID, 0)
      ' Set Comment Type  = INPUT
        retval = DmisCommand.SetToggleString (3, COMMENT_TYPE, 0)
      ' Set Comment Item 1 = 'Enter the workorder #,
        retval = DmisCommand.PutText ("'Enter the workorder #,", COMMENT_FIELD, 1)
      ' Set Comment Item 2 = using a period instead of a slash.'
        retval = DmisCommand.PutText ("using a period instead of a slash.'", COMMENT_FIELD, 2)
      ' Set Report  = NO
        retval = DmisCommand.SetToggleString (1, OUTPUT_TYPE, 0)


    What you probably need to look for is a way to mark all dimensions through code before executing the program. Look in the Wilcox script repository and search this site. I know there is a script that does this. So, you'd import your program, run this script, THEN execute the program, and everything would be hunky-dory.
Children
No Data