in-exe resources

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by JohanHaegg.

Would be neat if there where some way to link files into the program during compilation and then use them inside the program.
Either a resource-list where files could be included, or
a command that is removed during compilation. The command could then be called somewhat like:
StoreResource("c:\nisse.txt",1);only used in compilation, go nothing to do with the final executable

res = AllocateMemory(0,Len(Resource(1)),0) ;create memory block with size of resource
res = Resource(1) ;store data from resource to variable
PrintN(PeekS(res)) ;print the raw data resource as a string
PrintN(PeekS(Resource(1)) ;same thing, but without variable
res.s = PeekS(Resource(1)) ;and so on
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> Would be neat if there where some way to link files into the
> program during compilation and then use them inside the program.

viewtopic.php?t=4266
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by JohanHaegg.

Thanks, did not find it when i searched the forum before the request.
Post Reply