Page 1 of 2

A simple macro labels problem

PostPosted: Fri Aug 03, 2007 10:33 am
by Jsosnowski
I am writing a macro in the original Legacy version of DCAL (from Datacad version 9), something I have not done i n quite a while and hit a small bug.

To generate menus I have used the steps:
lblsinit;
lblset (1, name);
lblmsg (1, 'A message');
lblshow;

When the macro operates, the menu item shows up, but the message will not appear either in the message area at the bottom of the screen or as a hint adjacent to the function key menu. Is there a setting or something that I have neglected?

PostPosted: Fri Aug 03, 2007 12:19 pm
by Jon C. Hubart
This may be a typo but I think you should be using lblson not lblshow.

PostPosted: Fri Aug 03, 2007 12:27 pm
by Jsosnowski
It is a typo. I used lblson;

PostPosted: Tue Aug 21, 2007 8:42 am
by Jsosnowski
OK I got back to this problem after a few days and still cannot see why the messages do not appear when the mouse is over a menu button. What am I missing? :oops:

Here is an example that fails:

Program test;
VAR
Done : Boolean;
Key : integer;

PROCEDURE doLbls;
BEGIN
lblsinit;
lblset ( 1, 'File');
lblmsg (1, 'Select File');
lblsett (10, 'DoLyrs', true);
lblmsg (10, 'DO something');
lblset (20, 'Exit');
wrtlvl ('TEST');
lblson;
END doLbls;

PROCEDURE doesc;
VAR
Kaput : boolean;
Tempoffset : real;
BEGIN
IF key = s0 THEN
done := true;
END;
END doesc;

BEGIN
Done := false;
Repeat
doLbls;
getesc (key);
doesc;
until done;
END test.

PostPosted: Tue Aug 21, 2007 9:08 am
by Jon C. Hubart
See the attached image.
Image
When I compile the test you sent I am seeing flyouts and the message at the bottom of the screen. Are these what you are referring to? The "Select File" messages?

PostPosted: Tue Aug 21, 2007 9:17 am
by Jon C. Hubart
The only thing I can think of is an interface problem. You mention "the message area" in your original post but these messages are displayed on the "Coordinates / Hints" toolbar. Do you have that one turned on?

As for the flyouts, do you have your tooltips, Display Delay set too far to the right? Try moving it all the way left and see if that helps.

PostPosted: Tue Aug 21, 2007 9:26 am
by Jsosnowski
Yes, I don't get them on mine. Although I ran another macro (roof-it) that containes them in the code and the flyouts work. I am compliling using DCAL 5.00 Do you know which version you are using?

If not, you can find out when you run DCC1. If the messages run to fast, reroute the text to a file (eg dcc1 \Datacad\DCAL\test >test_a.rpt

Thanks

PostPosted: Tue Aug 21, 2007 9:37 am
by Jsosnowski
The settings are all the way to the right for display delay.
Coordinates are displayed when the cursor is moving in the drawing area.

PostPosted: Tue Aug 21, 2007 9:45 am
by Jon C. Hubart
Jsosnowski wrote:Yes, I don't get them on mine. Although I ran another macro (roof-it) that containes them in the code and the flyouts work. I am compliling using DCAL 5.00 Do you know which version you are using?

If not, you can find out when you run DCC1. If the messages run to fast, reroute the text to a file (eg dcc1 \Datacad\DCAL\test >test_a.rpt

Thanks

Compiler Version 5.00

Linker Version 4.01

PostPosted: Tue Aug 21, 2007 9:50 am
by Jon C. Hubart
If you want to post your e-mail address I can send you the version I compiled and you can see if you get flyouts on your system.

PostPosted: Tue Aug 21, 2007 3:56 pm
by Jsosnowski
I received your macro and tested it on my machine. No flyouts. There is definitely something squirrelly at my end. It must be a setting, but I can't find it. First time anything's ever gone wrong ......

Thanks

PostPosted: Wed Aug 22, 2007 6:30 am
by rod_walker
I am searching my memory a bit; but I think there is/was a bug.
I looked back thru my old code and seems my work around was to use getpoint(p,key) which does let flyers display. ie write a new getescape .

Rod Walker
Code: Select allPROCEDURE getescape(k:OUT integer);
 VAR
  result,key   :integer;
  p      :point;
  done      :boolean;
 

  BEGIN
  setpoint(p,0.0);
  done:=FALSE;
  REPEAT
   result:=getpoint(p,key);
   IF result=res_escape  THEN
    k:=key;
    done:=TRUE;
    END;
  UNTIL done;
  END getescape;

PostPosted: Thu Aug 23, 2007 9:18 am
by rod_walker
Joe
I compiled your macro and flyers worked on my new machine; but on my previous machine I had the same problem.

Modifying your code with a new 'getesc' based on getpoint achieves the same result with flyers.
Code: Select allProgram test;
VAR
Done : Boolean;
Key : integer;



PROCEDURE getescape(k:OUT integer);{this is new getesc}
 VAR
  result,key   :integer;
  p      :point;
  done      :boolean;
 

  BEGIN
  setpoint(p,0.0);
  done:=FALSE;
  REPEAT
   result:=getpoint(p,key);
   IF result=res_escape  THEN
    k:=key;
    done:=TRUE;
    END;
  UNTIL done;
  END getescape;

PROCEDURE doLbls;
BEGIN
lblsinit;
lblset ( 1, 'File');
lblmsg (1, 'Select File');
lblsett (10, 'DoLyrs', true);
lblmsg (10, 'DO something');
lblset (20, 'Exit');
wrtlvl ('TEST');
lblson;
END doLbls;

PROCEDURE doesc;
VAR
Kaput : boolean;
Tempoffset : real;
BEGIN

IF key = s0 THEN
done := true;
END;
END doesc;

BEGIN
Done := false;
Repeat
doLbls;
getescape (key);{replaces getesc}
doesc;
until done;
END test.


Rod Walker

PostPosted: Thu Aug 23, 2007 12:03 pm
by devinder
Could you email your Dcadwin.ini and the dcx macro to techsupport

PostPosted: Sun Aug 26, 2007 1:50 pm
by Jsosnowski
I forwarded the macro and inin file to tech. support.