Search found 42 matches

by Alex
Fri Dec 08, 2006 10:08 pm
Forum: Linux
Topic: VU Meter in Linux
Replies: 2
Views: 1828

VU Meter in Linux

Does anyone know how to write a VU meter in Linux? It doesn't need to do much, simply watch the sound input and output and show signal strength. I don't need a graphical component at this point, just a simple program that will watch the audio and give me some kind of numbers.

Thanks
by Alex
Wed Dec 06, 2006 5:42 pm
Forum: Linux
Topic: Screen Blanking With Purebasic
Replies: 2
Views: 1476

Excellent. That's perfect!

Alex

WishMaster wrote:You can try this:

Code: Select all

RunProgram("xset", "dpms force suspend", "")
or this:

Code: Select all

RunProgram("xset", "dpms force standby", "")
by Alex
Wed Dec 06, 2006 6:46 am
Forum: Linux
Topic: Screen Blanking With Purebasic
Replies: 2
Views: 1476

Screen Blanking With Purebasic

Does anyone know a good way to blank the screen with Purebasic under Linux? I need to be able to turn the screen off with a single mouse click, and have it turn back on in response to the usual kinds of input - mouse, keyboard, etc.

Alex
by Alex
Mon Apr 10, 2006 4:55 pm
Forum: Coding Questions
Topic: Need Calendar Help
Replies: 10
Views: 2672

Re: Need Calendar Help

Cool! Thankyou!

Alex
PB wrote:

Code: Select all

today=Date()
yesterday=AddDate(today,#PB_Date_Day,-1)
Debug FormatDate("%dd-%mm-%yyyy",yesterday)
by Alex
Mon Apr 10, 2006 3:24 am
Forum: Coding Questions
Topic: Need Calendar Help
Replies: 10
Views: 2672

Need Calendar Help

Has anyone written a routine to find the day before the current date? In other words, if it's April 3rd, 2004, I need a routine that give me April 2nd, 2004. This needs to handle such issues as leap years, months with 31, 30, or 28 days, etc.

Thanks,

Alex
by Alex
Sun Apr 09, 2006 7:24 pm
Forum: Linux
Topic: Port Error
Replies: 0
Views: 1316

Port Error

If my network application crashes and I need to restart it, I get the following error message:

"Waiting for port to open."

When I get this error message, it takes a minute or two for the port to clear, during which clients can't reach the server. Is there a way to proactively clear the port so it ...
by Alex
Sun Apr 09, 2006 5:22 pm
Forum: Coding Questions
Topic: Val Does Not Work on Zero
Replies: 44
Views: 9994

I've woken up now and i want to clarify one point. :)

Val("0")

This code does NOT return false. It returns the numeric value of the literal string passed. Which in Purebasic just so happens to be what it uses as a false value.

Pardon me for beating a dead horse, but doesn't this mean that any ...
by Alex
Sun Apr 09, 2006 9:03 am
Forum: Coding Questions
Topic: Val Does Not Work on Zero
Replies: 44
Views: 9994

Re: Val Does Not Work on Zero

I'm verifying. PB and I are fine.

Alex
by Alex
Sun Apr 09, 2006 6:52 am
Forum: Coding Questions
Topic: Val Does Not Work on Zero
Replies: 44
Views: 9994

PB wrote:> Mmm, pretty girls make everything better. :)
You are so right. :D

Alex
by Alex
Sun Apr 09, 2006 6:43 am
Forum: Coding Questions
Topic: Val Does Not Work on Zero
Replies: 44
Views: 9994

Hi Alex,

Val means "Value Of", not validate.

A false condition in PureBasic is one that returns 0, and a true condition is therefore anything that does not return a false, therefore anything other than zero.

The one and only purpose of Val() is to convert the contents of a string variable to a ...
by Alex
Sun Apr 09, 2006 6:23 am
Forum: Coding Questions
Topic: Val Does Not Work on Zero
Replies: 44
Views: 9994

Looking at your code, it seems to me you are after some kind of Isnumeric() routine, several examples of which you can find on the forum if you do a search. Val() is not designed for this task.

Thanks for the code snippet. I've found a workaround which works very nicely. In fact, I found it ...
by Alex
Sun Apr 09, 2006 6:14 am
Forum: Coding Questions
Topic: Val Does Not Work on Zero
Replies: 44
Views: 9994

Re: Val Does Not Work on Zero

>You are trying to use the command in a way it's not meant to be used! Can someone else here please tell him, because he's not willing to listen to me.

Thanks for the help you've offered. I do appreciate the attempt even though we disagree. We both want PureBasic to be better, and I'd rather stop ...
by Alex
Sun Apr 09, 2006 4:25 am
Forum: Coding Questions
Topic: Val Does Not Work on Zero
Replies: 44
Views: 9994

Re: Val Does Not Work on Zero

> To clarify: what I meant is that he is using Val incorrectly, which is why it fails
and doesn't give him the results he is expecting.

Val is meant to return a value of the string. That's why you can't use it like
"If Val(string$)" -- IT'S NOT MEANT TO BE USED THAT WAY. Read the manual ...
by Alex
Sat Apr 08, 2006 11:48 pm
Forum: Coding Questions
Topic: Val Does Not Work on Zero
Replies: 44
Views: 9994

Kale wrote:If the result of any expression or value that follows this 'If' keyword so happens to be a '0' (zero) then it is determined to be false. Otherwise it is true. :)
So any operation which results in a "0," no matter how accurate, will result in a "false" result in any test?

Alex
by Alex
Sat Apr 08, 2006 8:22 pm
Forum: Coding Questions
Topic: Val Does Not Work on Zero
Replies: 44
Views: 9994

Val("0") will return 0, which is false in condition.

Maybe I'm unclear on the concept. Shouldn't Val() (or any other operation) return two pieces of information; a true/false value AND a result, and shouldn't "If" look at the true/false value rather than the result?

Does Val("0") give a value of ...