English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 28 September 2016, 17:38   #1
alphagemini
Registered User
 
Join Date: Nov 2011
Location: Folkestone, Kent
Posts: 85
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  
AdSense AdSense  
Old 28 September 2016, 18:39   #2
Sinphaltimus
Registered User

Sinphaltimus's Avatar
 
Join Date: Aug 2016
Location: Cresco, PA, USA
Age: 47
Posts: 670
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, 17:19   #3
Dan
Registered User
Dan's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 349
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 offline  
AdSense AdSense  
 


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 10 February 2016 00:58
External windows program communicating with program running inside WinUAE xxxxx support.WinUAE 10 19 February 2013 10:27
Manuals for GFA Basic and Hi-Soft Basic 2 ricky500 request.Apps 20 12 February 2013 22:06
Which 'free' Basic language program? keitha1200 Coders. Language 29 04 October 2012 01:08
Alarm program in Hi Soft basic alphagemini Coders. General 6 05 August 2012 19: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 10:39.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.13083 seconds with 14 queries