English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 28 September 2016, 16:38   #1
alphagemini
Registered User
 
Join Date: Nov 2011
Location: Folkestone, Kent
Posts: 87
Basic program prob

I am using basic to write a program and have encountered a problem.
I need to use many 'and' 'or' statements and have run out of sufficient line length.
Does anyone know how to increase usable line length or continue condition statements onto the next line?

thanks in advance
alphagemini is offline  
Old 28 September 2016, 17:39   #2
Sinphaltimus
Registered User

Sinphaltimus's Avatar
 
Join Date: Aug 2016
Location: Cresco, PA, USA
Age: 48
Posts: 1,091
Couldn't you use more than one statement? If the condition is true up to a point then it's ok to continue the check on another line, if the condition is false anywhere in the first statement then no need to check the second because you've hit your else condition.
Sinphaltimus is offline  
Old 29 September 2016, 16:19   #3
Dan
Registered User
Dan's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 407
Can you give us an example of what you are trying to do ?

Here is an example of what you can do, its not the amiga basic syntax but you can get the Idea.

Code:
If (x=50 and y=70 and mousebutton=1) or (x=70 and y=80 and mousebutton=1) or (x=110 and y=200 and mousebutton=1)
  ...code
EndIf
In case they need to do all the same thing,then you can split it into following:

Code:
If mousebutton=1
  If x=50 and y=70 then check=1     
  if x=70 and y=89 then check=1
  if x=110 and y=200 then check=1
  (here you can use as many if's as you need) 
EndIf

If check=1 
  ...code
 check=0
EndIf
of course there are many ways to write this, so an example is needed with an explanation of what should be checked.
Dan is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pimp up your Basic skills ! BASIC Tenliner Competition 2016 ! SkulleateR Retrogaming General Discussion 6 09 February 2016 23:58
External windows program communicating with program running inside WinUAE xxxxx support.WinUAE 10 19 February 2013 09:27
Manuals for GFA Basic and Hi-Soft Basic 2 ricky500 request.Apps 20 12 February 2013 21:06
Which 'free' Basic language program? keitha1200 Coders. Language 29 04 October 2012 00:08
Alarm program in Hi Soft basic alphagemini Coders. General 6 05 August 2012 18:00

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.05866 seconds with 15 queries