News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Can't get Sys(1027) Function to work

Started by Reddog54, March 12, 2014, 05:23:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Reddog54

I am unable to get the Sys(1027) function to change from the default of "ok".  This is the Message Style Box for the Message Statement.  I want it to be yes/no question but can not get it to change from the default of "ok".  Here is the syntax I am using:
               Message "Do you wish to proceed? "
               sys(1027) = 4      'default
               if sys(1028) = 1 then    '1 is ok
               goto CONT
               end if
I have tried all the options available 0-5 and it never changes.  Also, if i try and X out instead of clicking on the OK button it still comes back as OK. Using DCAD v23, Any help would be appreciated

Steve

Lar

#1
Put the 1027 line before the message:
             
sys(1027) = 4      'default     ''''0 is the default (the one with just the 'ok' button)
Message "Do you wish to proceed? "
               if sys(1028) = **1** then    '1 is ok   '''''message type 4 issues a 6 or a 7  (yes/no)
               goto CONT
               end if


Type zero is the default (the one with just the 'ok' button)... Type 4 buttons issues a 6 or 7 (yes/no) so 1028 would never equal 1.

Here are the message box codes with the button names, and values in brackets:

'sys(1027)=0  'message box style = OK(1) (default)
'sys(1027)=1  'message box style = OK(1) /Cancel (2)
'sys(1027)=2  'message box style = Abort(3) / Retry(4) /Ignore(5)
'sys(1027)=3  'message box style = Yes(6) /No(7) /Cancel(2)
'sys(1027)=4  'message box style = Yes (6)/No(7)
'sys(1027)=5  'message box style = Retry(4) /Cancel(2)


I always put all of these in a macro that needs other than type 0 so I can find them easily. For the one I need I just click in front of the apostrophe and press enter, dropping the code to its own line and leaving the apostrophe on its own line for easy backspacing of the code when I copy and past them all to another macro. It also makes it clear which line I'm using. Eg, in the code below I am using message type 1.

'sys(1027)=0  'message box style = OK(1) (default)
'
sys(1027)=1  'message box style = OK(1) /Cancel (2)
'sys(1027)=2  'message box style = Abort(3) / Retry(4) /Ignore(5)
'sys(1027)=3  'message box style = Yes(6) /No(7) /Cancel(2)
'sys(1027)=4  'message box style = Yes (6)/No(7)
'sys(1027)=5  'message box style = Retry(4) /Cancel(2)


If I need another message type later in the macro I just copy and paste the line I need, minus the apostrophe.

Lar

prl

#2
Steve,

In addition to Lar's post, here is some sample code


Sys(1027) = 4 'Yes/No MessageBox style
Message "Warning, do you want to convert and explode all text to Arch font? YES for Arch Font conversion, NO for program exit?"
if sys(1028) = 6 then 'yes was clicked
   dx1$ = "A2"
   tfont$=dx1$+".vfn"
else 'anything else is a no
   gosub CleanExit
end if
.
.
.


Reddog54

#3
Apparently I didn't make myself clear.. I did not write this code as the way I wanted it to work..I wrote it because no mater what value I put for sys(1027) 0-5, the value for sys(1028) is ALWAYs = 1.  and the display screen always shows only "ok" button (see attached screen shot).  this was just a little test macro to find out what is going on so I will put the whole macro on here.  it never came back <> 1 even if I pressed the red X:

     Window 2, 40  ' open window 5 lines by 30 chars
     Print "This Macro is a test "
     anykey
     Message "Do you wish to proceed? "
     sys(1027) = 4      'default
     if sys(1028) = 1 then
      goto CONT
       end if
     goto skip
     CONT:
    Wclose
     Window 2, 40  ' reopen window 5 lines by 30 chars
     print "sys 1028 = 1"
    anykey
    goto end
    skip:
    Wclose
    Window 2, 40  ' reopen window 5 lines by 30 chars
   print "sys 1028 <> 1"
   anykey

   END:
   end
btw Lar, I think the  way you do it would be a great way to use it if it worked right, as you would have all the info about the inputs and outputs and just adj your apostrophe mark to meet your needs.  Thanks for that tip.

prl

#4
Steve,  try this, it will show you what you need to know.

Window 2, 40  ' open window 5 lines by 30 chars
     Print "This Macro is a test "
     anykey
     Message "Do you wish to proceed? "
     Message sys(1028)

     sys(1027) = 4      'yes/no
     Message "Do you wish to proceed? "
     Message sys(1028)

End

DrollTroll

Steve, you need to set Sys(1027) BEFORE you run the Message statement. Otherwise you're changing the messagebox style after you've already displayed the (default-style) message.
25 years with DesignCAD

Reddog54

#6
Quote from: DrollTroll on March 13, 2014, 09:35:33 AM
Steve, you need to set Sys(1027) BEFORE you run the Message statement. Otherwise you're changing the messagebox style after you've already displayed the (default-style) message.
That is what I was doing wrong.. when I moved it to before the Message statement it worked as it should (and it makes sense when I think about it).. Thanks for the advice and ty to everyone for the help!  (I see now where Lar said that in his first sentence but did not notice it till later)

Lar

#7
Steve, just curious... did you read the first line of my first post and the syntax in the code box that followed it? ;)

Lar
...I guess I had too much bells and whistles I that post...

Reddog54

Yes Lar I did see that.. just not at the time you posted it, I skipped right by the line that would have corrected my problem and did not realize it till I was looking back through all the post from everyone... I mentioned it in my last post  in fact:
       
Quote from: Reddog54 on March 13, 2014, 11:56:45 AM
  (I see now where Lar said that in his first sentence but did not notice it till later)

and your right I got distracted by some of your bells and whistles that you had up there but they were very helpful as well.    Again, Thanks to all who posted, your input is much appreciated :)