Search found 26 matches

by John Puccio
Tue Nov 17, 2009 1:48 pm
Forum: Coding Questions
Topic: Retreiving the Internet IP?
Replies: 11
Views: 1918

Re: Retreiving the Internet IP?

Not sure what you're trying to do, but if you are running a web server then.


OpenConsole()
PrintN(GetEnvironmentVariable("REMOTE_ADDRESS")) ; The IP address of the visitor
CloseConsole()


The exact name of the environment variable will depend on the server. Could also be "REMOTE_ADDR"
by John Puccio
Mon Oct 12, 2009 11:53 pm
Forum: Coding Questions
Topic: Email
Replies: 4
Views: 703

Re: Email

Ghost,

The nice thing about Gmail is that the focus is already set on UserName so you won't have to move the mouse. So then all you have to do is send your username then {TAB} then password, {TAB} again, and last {ENTER}. I think what you're looking for is in this thread.

http://www.purebasic.fr ...
by John Puccio
Thu Oct 08, 2009 7:31 pm
Forum: Coding Questions
Topic: Serial Port Timeout Detection
Replies: 6
Views: 3440

Re: Serial Port Timeout Detection

Thanks for the replies.

So when the serial port 'times out' after an interval set by SerialPortTimeouts it just closes and disappears ?

I was hoping for something more useful - I suppose it is back to the kludge of using the API timer to periodically check if any characters have appeared in the ...
by John Puccio
Wed Oct 07, 2009 9:24 am
Forum: Coding Questions
Topic: Serial Port Timeout Detection
Replies: 6
Views: 3440

Re: Serial Port Timeout Detection

Hi KH 1 thru 0,

Serial ports don't exactly time out, they are closed just like a file. Basically the host program says "if I do not see activity for X amount of time then close the port" that's how you get a timeout. What you need to do is look at the DCD line (Data Carrier Detect) if it is low ...
by John Puccio
Mon Sep 21, 2009 4:54 am
Forum: Coding Questions
Topic: Executing an .exe file from within another pb app.
Replies: 8
Views: 1959

Re: Executing an .exe file from within another pb app.

I've not actually tried this yet but, would running it from a batch file fix the problem?

JP
by John Puccio
Wed Sep 02, 2009 7:50 am
Forum: Coding Questions
Topic: Is basic a single line single instruction code language?
Replies: 16
Views: 2030

Well Alan, you've come to the right language. Single line coding is considered to be poor style. As your code grows and you gain experience you will no longer do this.

a$=B$:X=1

instead you will do this

a$ = B$
X = 1

There are exceptions of course, but generally speaking it's not a good way to ...
by John Puccio
Tue Sep 01, 2009 5:38 am
Forum: Feature Requests and Wishlists
Topic: [Implemented] switch var1, var2
Replies: 26
Views: 5620

Trond wrote:Since we have the new structure assignment, I request this feature to work for structured types as well.
+1 @Trond's request. I think that would be really neat!
by John Puccio
Tue Aug 18, 2009 3:02 am
Forum: Coding Questions
Topic: ProgressBar on StatusBar?
Replies: 12
Views: 2483

Demivec wrote:If you drag the window partially offscreen, then drag it back again, you can't see the ProgressBar afterwards with your code.
Well how about that, just the opposite.. :oops: The height of the progress bar is taller than the status bar with skin support off. What exactly is going on here?

JP
by John Puccio
Tue Aug 18, 2009 2:28 am
Forum: Coding Questions
Topic: ProgressBar on StatusBar?
Replies: 12
Views: 2483

This works too :)

With or without skin support. But with skin support off the progress bar is a few pixels taller than the status bar. Strange..

Enumeration
#Window
#StatusBar
#ProgressBar
EndEnumeration

If OpenWindow(#Window,#PB_Ignore, 0, 200, 100, "Status Test")
ProgressBarGadget ...
by John Puccio
Tue Aug 11, 2009 7:18 am
Forum: General Discussion
Topic: Program Layout
Replies: 4
Views: 1716

Re: Program Layout

Is there anywhere I could get a large size snippet of a Program that has a Menu and a Splash Screen. Examples are so small that I don't understand how they work with others.I'm 80 years old and I'm trying to re-write a
check register program that I wrote for dos years ago. A snippet of a Recipe ...
by John Puccio
Tue Aug 11, 2009 5:20 am
Forum: Feature Requests and Wishlists
Topic: My wishlist for PureBasic 4.50
Replies: 103
Views: 26021

I have code that I wrote 30 years ago and it makes no sense to me now. 20 years ago, I have to study it for a while. 10 years ago, I can read it and understand what it does easily. The whole idea behind the Basic language is readability. Basic was invenetd as an exercise in NL (Natural Language) it ...
by John Puccio
Sat Aug 08, 2009 11:05 pm
Forum: Coding Questions
Topic: AddKeyboardShortcut not working
Replies: 13
Views: 4020

I'll keep that in mind Kaeru. I'll just have to wait and see how the code evolves over time.

In this case I am re-creating an old dos program I wrote 10+ years ago. So I am attempting to create the same look and feel of the original program. It won't have any menus. The buttons are the menu so it's ...
by John Puccio
Sat Aug 08, 2009 10:40 pm
Forum: Coding Questions
Topic: AddKeyboardShortcut not working
Replies: 13
Views: 4020

Yes that is exactly how I want it to work.

all I needed from your example was
Case #PB_Event_Gadget, #PB_Event_Menu

what I had before was
Case #PB_Event_Gadget
...
...
...

and then a second identical select with
Case #PB_Event_Menu
...
...
...

Thank you Trond for providing this most ...
by John Puccio
Sat Aug 08, 2009 11:16 am
Forum: Coding Questions
Topic: AddKeyboardShortcut not working
Replies: 13
Views: 4020

That's true if that is the only way it will work, but if there is another way then it is code duplication. BTW I looked for Event_Type could not find it.. There is EventType() which is something completely different.

I tried to put #PB_Event_Menu and #PB_Event_Gadget in a seperate select then ...
by John Puccio
Sat Aug 08, 2009 9:10 am
Forum: Coding Questions
Topic: AddKeyboardShortcut not working
Replies: 13
Views: 4020

Kaeru Gaman wrote:"elegant" is not a single Select, but a beautiful structural tree subdividing with 42 Selects.
"elegant" is a fractal with a deep recursion, not a flat line.
Elegant is finding ways to avoid code duplication whenever possible.. ;)

Thanx for the tip!
JP