Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Porting from C / Allegro to DB Pro

Author
Message
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 16th Jun 2003 19:09
Hello all

I am porting a programme written in C (with the Allegro libraries) to DB Pro.

Obviously this entails quite a lot of mucking about with the commands.

I am wondering what people think might be the closest command to the STRUCT command in C / Allegro. I have the horrible feeling that I may have to write a DB Pro function which replicates the command. I don't want to do this as I have a better use for the next few weeks!

All views hugely welcome.
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 16th Jun 2003 19:18 Edited at: 16th Jun 2003 19:20
Use the following type definitions as an alternative in DBPro.

Type <TypeName>
var1 As Type
var2 As Type
...
End Type


Allegro is a great system by the way.

<EDIT> Best also note that you can't pass Types like this directly into functions in DBPro, the way to do it is to declare an array of the user defined type and pass the array into functions instead, that's the easiest way to do it.

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 17th Jun 2003 00:31
You can however pass pointers to types into functions. You are not supposed to be able to get pointers to types, but it seems possible.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_103.zip
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 17th Jun 2003 14:12
Rob K, I've never tried that yet with the new patches, very useful feature indeed

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.

Login to post a reply

Server time is: 2026-07-11 14:56:16
Your offset time is: 2026-07-11 14:56:16