Post Reply 
Sharing Code Between Programs
01-16-2022, 10:44 PM
Post: #3
RE: Sharing Code Between Programs
(01-16-2022 10:15 PM)Didier Lachieze Wrote:  Any reason to have these defined as CAS programs while they don’t use any CAS function?

I would rather define them as PPL programs and with EXPORT they would be callable from other programs :

Code:
#pragma mode( separator(.,;) integer(h32) )

EXPORT DrawShiftMark()
BEGIN
 LOCAL c2:=RGB(0,255,255);
 FILLPOLY_P(G0,{{2,7},{2,3},{1,3},{3,1},{5,3},{4,3},{4,7}},c2);
 PIXON_P(G0,11,2,c2);
 LINE_P(G0,8,1,10,1,c2);
 LINE_P(G0,7,2,7,3,c2);
 LINE_P(G0,8,4,10,4,c2);
 LINE_P(G0,11,5,11,6,c2);
 LINE_P(G0,8,7,10,7,c2);
 PIXON_P(G0,7,6,c2);
END;

EXPORT ClearShiftMark()
BEGIN
 LOCAL x_left:=1;
 LOCAL x_right:=11;
 LOCAL y_top:=1;
 LOCAL y_bottom:=7;
 LOCAL Y;
 FOR Y FROM y_top TO y_bottom DO
  LOCAL bg:=GETPIX_P(G0,x_right+1,Y);
  LINE_P(G0,x_left,Y,x_right,Y,bg);
 END;
END;

Weirdly, I was getting errors with that method. Ideally, I'd like to arrange these as "UI.DrawShift" and "UI.ClearShift". Unfortunately, that requires CAS to do. Getting it to work is proving challenging. They appear to have gone to great lengths to prevent the use of those structures in code.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Sharing Code Between Programs - IHarwell - 01-16-2022, 08:44 PM
RE: Sharing Code Between Programs - IHarwell - 01-16-2022 10:44 PM
RE: Sharing Code Between Programs - BruceH - 01-19-2022, 12:29 AM



User(s) browsing this thread: 2 Guest(s)