Liberty BASIC Community Forum
« Spent two hours on this problem »

Welcome Guest. Please Login or Register.
Sep 21st, 2017, 12:17am


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Spent two hours on this problem  (Read 196 times)
milfredo
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx Spent two hours on this problem
« Thread started on: Sep 1st, 2017, 02:49am »

It's late and I am really struggling with this. Can you tell me what I'm doing wrong. Can't get the printed material to print at the right spot.

Code:
 nomainwin
    WindowWidth = 900
    WindowHeight = 600
    UpperLeftX=int((DisplayWidth-WindowWidth)/2)
    UpperLeftY=int((DisplayHeight-WindowHeight)/2)


    '-----Begin GUI objects code

    button #Pace.button1,"Close",[closepace], UL, 395, 522,  75,  25

    '-----End GUI objects code

    open "Pace Pressure" for graphics_nsb as #Pace
    print #Pace, "down;fill buttonface; flush"
    print #Pace, "color black; backcolor buttonface"
    print #Pace, "font ms_sans_serif 10 Bold"
    print #Pace.button1, "!font ms_sans_serif 10 Bold"
    print #Pace, "trapclose [quit.Pace]"
print #Pace, "down"
    Y1 = 100
    Y2 = 100
    Y3 = 100
    Y4 = 100
    X1 = 50
    X2 = 170
    X3 = 320
    X4 = 470
   for v = 0 to numb-1
if nameofhorse$(srt(v,0)) = "" then
goto [noname]
ELSE
pacenumber = holder(srt(v,0),69)
gosub [getpacenumber]

print #Pace, "posxy  lenth  depth "

print #Pace, "\";  holder(srt(v,0),69)

END if
 [noname]
next v


[getpacenumber]

SELECT CASE
  CASE (pacenumber > 0) and (pacenumber < 28)
    lenth = X1
    depth = Y1
    Y1 = Y1+30
  CASE (pacenumber  > 27) and (pacenumber  < 45)
   lenth = X2
    depth = Y2
    Y2 = Y2+30
  CASE (pacenumber > 44) and (pacenumber < 65)
     lenth = X3
    depth = Y3
    Y3 = Y3+30
  CASE (pacenumber  > 64) and (pacenumber < 200)
    lenth = X4
    depth = Y4
    Y4 = Y4+30

  END SELECT

  Return
 


Thanks
Milfredo

Change by Stefan: added code tags
« Last Edit: Sep 1st, 2017, 03:30am by Stefan Pendl » User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5526
xx Re: Spent two hours on this problem
« Reply #1 on: Sep 1st, 2017, 04:38am »

POSXY command stores the current XY position in lenth depth.

It looks to me like you want to use the lenth and depth you obtained from your select case lookup.

So the correct command to use is PLACE lenth depth.
User IP Logged

milfredo
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx Re: Spent two hours on this problem
« Reply #2 on: Sep 2nd, 2017, 12:01am »

I tried to use place and nothing gets printed.


User IP Logged

milfredo
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx Re: Spent two hours on this problem
« Reply #3 on: Sep 2nd, 2017, 12:10am »

print #Pace, "place 170 "; depth
That works but I need a variable for the X but I can only get it to print by using a literal.


I am totally stumped.
User IP Logged

milfredo
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx Re: Spent two hours on this problem
« Reply #4 on: Sep 2nd, 2017, 12:45am »

Finally figured it out. Here's the solution....

print #Pace, "place "; lenth; " "; depth
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls