HP Forums

Full Version: KILL command.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
HI,

Why have-I this message (see attachement please), when I am using KILL in a program ?

And what it's means ?
HI,
I had forgotten that was discuss in a old thread from 2015,0929 but I wonder why
this error text in french language still remain in FW 10638 ?

BTW what about a *STOP* instruction ?
The KILL; command stops a program, (the BREAK; command exits from a loop). What else would you want a STOP command to do?
I would like a command without any string as we see in the attachement. A kind of *GOTO*. And also that the issue in language is corrected. I know it is not very important but...

Thanks for answer.
Quote:A kind of *GOTO*.

How does a STOP command work as a GOTO branch?
How would stopping a program with STOP be any different than with the KILL command, which stops a program?

If you want progress inspection at a STOP point, using the DEBUG; statement at the point of interest, or use DEBUG <filename> provides break point, single step, and variable inspection functionality.
You could add numbered trace variables at various points in a program, then stop by testing: IF (trace==xxxx) THEN KILL; END; or similar code.

What else would a STOP command need to do?
Regarding the strange symbols:

Normally, the message (in English) should say: "<name of program> Program interrupted" when run from the Programs menu. When run from the command line, one simply gets the error message "Program interrupted."

It is quite possible that the system messages for interrupting a program have not been translated properly.

EDIT: I just changed my language to Francais and indeed I see the same symbols. It looks like a bug (wrong translation) in the system strings for French.
So this highlights one of the frustrations in dealing with translations...

Basically, this WAS corrected, but later during a subsequent translation the "translation matrix" matched the string to an older "validated translation" and reverted it. I've corrected it yet again and hopefully it will stick this time.
Thak Team and others. I dont' realy explain what I would like. Impossible with my english ! I try : when my test say that there is an mistake, I would like *stop" the program with out any comment and after my text of error I would like go back to my program.

In attachement I would like that after my MSGBOX is display, that KILL stop my programme and go back to TSTDate for re-asking where was the mistake.
I think I understand now. First, are you using the connectivity kit to develop your program? If so, please copy and paste your code between the # tags on the forum editor (top right side). That will make it much easier for people to cut and paste your code.

You could make a subroutine for the code shown, and call it from a REPEAT END or WHILE END loop in an earlier part of your program. Instead of KILL, you would use RETURN.

I could also suggest that you use the drawmenu facility to create a front-end processor for your program (I hope you find this useful):

Code:

// Subroutine declaration
subr();clrscrn();
LOCAL a_string, blue:=rgb(0,0,255);   // Local to main and subroutines
EXPORT menu()
BEGIN
  LOCAL m,m1,mx,my; // Mouse vars
  clrscrn;
  //Main loop 
  While 1 DO
    WHILE MOUSE(1)>=0 DO END;  // get mouse XY coordinates
    //Selection loop
    REPEAT
      m:=MOUSE;
      m1:=m(1);
    UNTIL SIZE(m1)>0;      
    mx:=m1(1);
    my:=m1(2);  
    // query softbuttons
    IF my>=220 AND my<=239 THEN
      // "Btn1" Menu button 1      
      IF mx>=0 AND mx<=51 THEN
        clrscrn;
        subr;
        clrscrn; 
        TEXTOUT_P(a_string, 160-(9*SIZE(a_string)/2),110,7,blue);
      END;  //"Btn1" Btn 1
      // "Btn2" Menu button 2 
      IF mx>=53 AND mx<=104 THEN
      END;  //  "Btn2" btn 2
      // "Btn3" Menu button 3 
      IF mx>=106 AND mx<=157 THEN
      END;    //  "Btn3" btn 3    
      // "Btn" menu button 4
      IF mx>=159 AND mx<=210 THEN              
      END;   //  "Btn4" btn 4
      //"Btn5" menu button 5
      IF mx>=212 AND mx<=263 THEN       
      END;   //  "Match" btn 5
      // menu button 6 Exit
      IF mx>=265 AND mx<=316 THEN
        RETURN "Exit" ;
      END;   //  Menu btn 6      
    END;  // Selection loop  
  END;  // Main loop
END;  // program
//  =========================================  SUBROUTINES HERE  ====================================
clrscrn()
BEGIN
  RECT();           // Clear Screen
  DRAWMENU("FRANCE","Btn2","Btn3","Btn4","Btn5","Exit");     // Menu labels
END;
// ===========================================================================​=======================
// ====================================== END OF clrscrn Subroutine =================================
subr()
BEGIN
  a_string:="Vive la France";
  RETURN a_string;
END;
// ===========================================================================​=======================
// ====================================== END OF subr Subroutine ====================================
Thank DrD !

Double thank for the "Vive la France". I give my program for you see. I will studie
your code for me programing. It is of course a good idea and loops you sugest and what I dont' have my way to did.


Code:

EXPORT TSTDate(J,M,A)
BEGIN
LOCAL ND, TST, BISS:=0;
CASE
  IF J*M*A==0 THEN MSGBOX("Date= "+J+"/"+M+"/"+A+"?");KILL;END;
  IF J<1 OR J>31 OR FP(J)≠0 THEN MSGBOX("Date= "+J+"/"+M+"/"+A+"?");KILL;END;
  IF M<1 OR M>12 OR FP(M)≠0 THEN MSGBOX("Date= "+J+"/"+M+"/"+A+"?");KILL;END;
  IF A<−4712 OR A>9999 OR FP(A) ≠ 0 OR A=0 THEN MSGBOX("Date= "+J+"/"+M+"/"+A+"?");KILL;END;
  IF M==04 OR M==06 OR M==09 OR M==11 AND J>30 THEN MSGBOX("Date= "+J+"/"+M+"/"+A+"?");KILL;END; 
END;

IF A==1582 THEN
TST:=A+M/100+J/10000 ELSE END;

IF (A==1582 AND (TST>1582.1004
AND TST<1582.1015)) 
THEN MSGBOX("Date= "+J+"/"+M+"/"+A+"?");KILL;END;

IF A MOD 4==0 AND(A MOD 400==0
   OR A MOD 100≠0)
   THEN BISS:=1
END;

IF A MOD 4==0 AND A<1582 
   THEN BISS:=1 END; 

IF M==2 AND BISS==1 
  AND J>29 THEN MSGBOX("Date= "+J+"/"+M+"/"+A+"?");KILL;END;

IF M==2 AND BISS==0
   AND J>28 THEN MSGBOX("Date= "+J+"/"+M+"/"+A+"?");KILL;END;

MSGBOX("Date OK");
            
END;
You're very welcome. I use that framework a lot, and I hope it might be of use for you. Being able to select activities via soft keys can be very efficient. So good luck ...

-Dale-
Reference URL's