basicprogramming.org


Welcome, Guest. Please login or register.
Did you miss your activation email?
Forum time; Jul 31. 2010, 03:40
Home Help Search Calendar Login Register
News: Have you got suggestions for BasicProgramming.org? Let's hear them!
Interested in creating your own programming language? Check out the QDepartment group!

+  BASIC programming forum
|-+  Basic Coding
| |-+  General Basic Programming
| | |-+  Q&A
| | | |-+  Yabasic - Help
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Reply Print
Author Topic: Yabasic - Help  (Read 390 times)
Mainchip
Guest
« on: Jan 11. 2008, 13:21 » Reply with quote

Hi,

How can i:

Code:
intel = intel + random number between 0 - 1

Is there some kind of way to stop the maxium decimal places aswell so it will only be

0.1

and not

0.123456789

Thank you,
Report to moderator   Logged
E.K.Virtanen
Blah
Hero Member
*****
Offline Offline

Posts: 2441



WWW
« Reply #1 on: Jan 11. 2008, 13:31 » Reply with quote

Code:
value = int(ran(maxValue)) + 1

int returns an integer value, not double (decimals)
Report to moderator   Logged

Mainchip
Guest
« Reply #2 on: Jan 11. 2008, 13:37 » Reply with quote

Nice, thanks alot E.K
Report to moderator   Logged
Mainchip
Guest
« Reply #3 on: Jan 11. 2008, 13:39 » Reply with quote

Is it posible to open yabasic in a bigger window?

Report to moderator   Logged
E.K.Virtanen
Blah
Hero Member
*****
Offline Offline

Posts: 2441



WWW
« Reply #4 on: Jan 11. 2008, 15:00 » Reply with quote

Bigger window?

You mean when you start up "yabasic.exe", it would open in full screen?
Report to moderator   Logged

Mainchip
Guest
« Reply #5 on: Jan 11. 2008, 15:02 » Reply with quote

Yes thats what i mean.
Report to moderator   Logged
E.K.Virtanen
Blah
Hero Member
*****
Offline Offline

Posts: 2441



WWW
« Reply #6 on: Jan 11. 2008, 15:11 » Reply with quote

Well, if you use it with windows then i guess there is some options how to open it in full screen. Mystik, give me a hand here please Smiley

If you want to change source of yaBasic so, then ill suggest you to ask from PSnake, which is the one who knows the source best of us.
Report to moderator   Logged

psnake
Sr. Member
****
Offline Offline

Posts: 438



« Reply #7 on: Jan 11. 2008, 15:36 » Reply with quote

Is it posible to open yabasic in a bigger window?

It's something I'll have to look at.
At least it sounds simple, maybe just need to change a flag or two. I'll try to do it tonight or tomorrow morning.

Regards,
PSnake
Report to moderator   Logged

twitter: @PSnake89
psnake
Sr. Member
****
Offline Offline

Posts: 438



« Reply #8 on: Jan 11. 2008, 17:02 » Reply with quote

Ok, it's done!

To open a window i fullscreen you can give (optionally) the fullscreen flag like this:

Code:
open window 100,100,fullscreen

Note that you can still give the usual open window command so no code broken Cheesy .
If you want to get the actual window size just do:
Code:
width = peek("winwidth")
height = peek("winheight")

The new version is, as usual, here. It has today's date on it.
You may notice that the filesize is kind of big, it's because of git (the version manager I'm using) every change from 2.763 is avaiable so it occupies some space. I'll do something about that tomorrow. Also need to update the site.

Best Regards,
PSnake
« Last Edit: Jan 11. 2008, 17:06 by psnake » Report to moderator   Logged

twitter: @PSnake89
Derek
Administrator
Hero Member
*****
Offline Offline

Posts: 1001



WWW
« Reply #9 on: Jan 12. 2008, 01:21 » Reply with quote

Hi,

How can i:

Code:
intel = intel + random number between 0 - 1

Is there some kind of way to stop the maxium decimal places aswell so it will only be

0.1

and not

0.123456789

Thank you,

Hi,
I haven't yet installed Yabasic on my new Ubuntu installation so I haven't tested this:
Code:
RandomNumber = int(ran() * 10) / 10

I read your request for fullscreen as being for the console was everyone else right and me wrong?

Psnake:
Thanks for the new function. I know it will be very useful.

Derek.
Report to moderator   Logged

wget http://*
psnake
Sr. Member
****
Offline Offline

Posts: 438



« Reply #10 on: Jan 12. 2008, 05:29 » Reply with quote

I read your request for fullscreen as being for the console was everyone else right and me wrong?

Oops
I read everything again, I think I was the one who was wrong.

Every shell implementation has it's own ways to go fullscreen, I think it can't be changed (at least in a standard way) from within a program, but I may be wrong about this.

In Windows if I remember correctly if you press Alt+Enter it opens the shell in fullscreen.

Psnake:
Thanks for the new function. I know it will be very useful.
Thanks.

Best Regards,
PSnake
Report to moderator   Logged

twitter: @PSnake89
Pages: [1] Go Up Reply Print 
« previous next »
Jump to:  
Atom RDF RSS 0.91 RSS 2.0


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!