Search found 38 matches

by codefire
Sat May 03, 2008 6:39 pm
Forum: Windows
Topic: Opening the registry
Replies: 6
Views: 3141

God I'm dumb!

Now I remember why I always hated spaces in path names...

Thanks a lot guys! :)
by codefire
Sat May 03, 2008 11:40 am
Forum: Windows
Topic: Opening the registry
Replies: 6
Views: 3141

Opening the registry

I'm trying to write some code to read some values from the registry. Here's what I have so far - however, the code always fails to open the registry. Any ideas why?


hKey.l


OpenConsole()
Str.s = "Software\Microsoft\WindowsNT\CurrentVersion"
RetCode.l = RegOpenKeyEx_(#HKEY_LOCAL_MACHINE, @Str ...
by codefire
Mon Apr 28, 2008 10:08 am
Forum: Coding Questions
Topic: Simple way to get a web page?
Replies: 7
Views: 3302

That's exactly what I need :)

Many thanks - I'll upgrade from 4.10 to 4.20 Beta later today.
by codefire
Mon Apr 28, 2008 9:33 am
Forum: Coding Questions
Topic: Simple way to get a web page?
Replies: 7
Views: 3302

Simple way to get a web page?

Does anyone know a simple way to download a webpage over the Net in PureBasic?

I'm looking for something like:

Code: Select all

GetWebPage(file, "http://www.somesite.com/page.html")
Basically I just want to get a page - I can do the processing after that.

Many thanks,
Tony
by codefire
Sat Apr 26, 2008 3:38 pm
Forum: Windows
Topic: Calling Win32 API from PureBasic examples
Replies: 2
Views: 2483

Thanks. It's handy the structures are pre-defined :)
by codefire
Sat Apr 26, 2008 12:34 pm
Forum: Windows
Topic: Calling Win32 API from PureBasic examples
Replies: 2
Views: 2483

Calling Win32 API from PureBasic examples

Hi,

I'm looking for some examples on calling Win32 API from PureBasic.

I have:
- access to the Win32 Help on MSDN
- looked at the example win32 api PB example (draw an ellipse)

I need more information and examples.

In particular I'd like to start with a simple example: calling GetSystemTime ...
by codefire
Thu Apr 12, 2007 7:59 am
Forum: Coding Questions
Topic: PB NO
Replies: 24
Views: 4311

Codefire,
'Long' and 'Quad' are structures. Defining 'myVariable.Long' is not the same as 'myVariable.l'. What you can't do is 'SizeOf(.l)' and the like (although you can get the SizeOf() the variables themselves if the base type is not included, i.e. 'Debug SizeOf(myVariable)' ). ;)

...snip ...
by codefire
Thu Apr 12, 2007 7:54 am
Forum: Coding Questions
Topic: Division problems
Replies: 3
Views: 1239

Yes, that's fixed it...thanks guys!
by codefire
Wed Apr 11, 2007 7:49 pm
Forum: Coding Questions
Topic: PB NO
Replies: 24
Views: 4311


snip...
I translate it to PB:
h_verlen.c=(4<<4)|(SizeOf(ipHeader)/SizeOf(long))

Interestingly enough the docs for 4.02 state that SizeOf() only works on structures and not on base types. However, you are right it works fine on base types:


If OpenConsole()
PrintN("sizeof long is:"+Str(SizeOf ...
by codefire
Wed Apr 11, 2007 7:38 pm
Forum: Coding Questions
Topic: Division problems
Replies: 3
Views: 1239

Division problems

Here's my code:


Declare TestDivision ()

Procedure TestDivision ()

x.q = 4192456821
y.q = x/60
z.q = y*60
If OpenConsole()
PrintN(Str(x))
PrintN(Str(z))
Print("Hit enter to continue")
Input()
EndIf
EndProcedure

TestDivision()



I get:
-102510475
-102510496
Hit enter to continue

If ...
by codefire
Tue Apr 10, 2007 2:14 pm
Forum: Off Topic
Topic: Paint Shop Pro 7 - splitting sprite sheet
Replies: 5
Views: 1460

..and here for posterity is the actual code I used. It seems PureBasic makes things very easy :) Thanks Traumatic.

Codefire.


#IMAGE_WIDTH = 480
#IMAGE_HEIGHT = 360
#CHUNK_WIDTH = 80
#CHUNK_HEIGHT = 60

Enumeration
#original_image
#new_image
EndEnumeration

filename.s = "ship05.bmp"
result.l ...
by codefire
Mon Apr 09, 2007 7:55 am
Forum: Coding Questions
Topic: Debugger problem
Replies: 5
Views: 1065

Trond wrote:What happens if you switch to another source then back?
Bizarrely a reboot seems to have fixed it. If it happens again I will try what you suggested.

Cheers,
Codefire
by codefire
Sat Apr 07, 2007 8:57 am
Forum: Off Topic
Topic: Paint Shop Pro 7 - splitting sprite sheet
Replies: 5
Views: 1460

Re: Paint Shop Pro 7 - splitting sprite sheet

I don't know about PSP but why don't you write a simple program in PB to
accomplish this task?

Something like this (not much more than pseudo-code):

For y=0 To #imageWidth-1 Step #sliceWidth
For x=0 To #imageHeight-1 Step #sliceHeight
GrabImage(#originalImage, #sliceImage, x, y, #sliceWidth ...
by codefire
Sat Apr 07, 2007 8:56 am
Forum: Off Topic
Topic: Paint Shop Pro 7 - splitting sprite sheet
Replies: 5
Views: 1460

codemaniac wrote:I recall having seen a function like that in Jasc Animation Shop.. might be worth to look at..
I was looking at it, but to be honest I'm rubbish at graphics :) I'll have another look....I'm sure there's a function in there to do it...somewhere...
by codefire
Fri Apr 06, 2007 9:07 pm
Forum: Off Topic
Topic: Paint Shop Pro 7 - splitting sprite sheet
Replies: 5
Views: 1460

Paint Shop Pro 7 - splitting sprite sheet

Hi.

I have a single sprite sheet (bitmap file) with a number of frames for an animation on it. I want to split the sheet so that each frame goes into a seperate bitmap file.

Does anyone know how I can do that in PSP or even MS Paint? Or is there some tool out there to do it?

Cheers,
Codefire