Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Oct 24, 2014 8:27 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 62 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: iOS Compiler from VB to RB
PostPosted: Thu Jul 28, 2011 1:57 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
I have a compiler which I've developed to create apps on Windows for iPhone and iPad, in Visual Basic. I have ported about 80% of the code to RB so that iOS compiling will be possible on Windows, Mac, and Linux in a smaller than XCode..but XCode similar environment which can be stored on a flash drive or other portable media..in order to finish the project (which is yes, free) I need to convert the following code from Visual Basic 6.0 to Real Studio 2011 but have no idea where to begin with this one..the Resource lines are an array..but writing the array in the necessary sequence and appending correctly has me baffled :-)


'=============================================
' iOS Compiler with 4.0 Optimization
' Module: NIB Creation
' By: Matthew Combatti
' http://www.oh-darn.com
'=============================================
Dim ResourceData(4)

If Dir(".\MainWindow.nib") <> "" Then
Kill ".\MainWindow.nib"
End If

ResourceData(1) = "4E4942417263686976651 0 0 0 9 0 0 0 120 0 0 320 0 0 190 0 0 680 0 0 2E0 0 0 F51 0 0 8 0 0 0 3F3"
ResourceData(2) = "55494E6962456E636F646572456D7074794B6579875549477265656E885943656E"
ResourceData(3) = "658AA 2 0 0 0 82A 4 0 0 0 90A 9 0 0 0 95A 1 0 0 0 86A 1 0 0 0 835 835 87A 8 0 0 0 87A"
ResourceData(4) = "0 4 916 0 0 803F886 0 0 803F816 0 0 803F936 0 0 803F8F8 9A57656256696577547"
DF = FreeFile
Open ".\MainWindow.nib" For Output As #DF
For i = 1 To 4
a$ = ResourceData$(i)
While Len(a$) > 0
b$ = "&H" & Left$(a$, 2)
a$ = Right$(a$, Len(a$) - 2)
Print #DF, Chr$(Val(b$));
Wend
Next i
Close #DF

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Thu Jul 28, 2011 8:32 am 
Offline

Joined: Sat Dec 20, 2008 5:09 am
Posts: 32
Location: Austria, Vienna
Hello,

is not well tested, but should work.

Peter

Sub Test()
Dim ResourceData(4) As String

Dim f as FolderItem
f = GetFolderItem("E:\MainWindow.nib")
If (f <> Nil) And f.Exists Then
f.Delete
End If

ResourceData(1) = "4E4942417263686976651 0 0 0 9 0 0 0 120 0 0 320 0 0 190 0 0 680 0 0 2E0 0 0 F51 0 0 8 0 0 0 3F3"
ResourceData(2) = "55494E6962456E636F646572456D7074794B6579875549477265656E885943656E"
ResourceData(3) = "658AA 2 0 0 0 82A 4 0 0 0 90A 9 0 0 0 95A 1 0 0 0 86A 1 0 0 0 835 835 87A 8 0 0 0 87A"
ResourceData(4) = "0 4 916 0 0 803F886 0 0 803F816 0 0 803F936 0 0 803F8F8 9A57656256696577547"

Dim c,k, iLen As Integer
Dim iByte As Integer
Dim s As String
Dim b as BinaryStream
f = GetFolderItem("E:\MainWindow.nib")
If f <> Nil then
b = BinaryStream.Create(f, True)
For c = 1 To 4
iLen = ResourceData(c).Len
For k = 1 To iLen Step 2
s = Mid(ResourceData(c), k, 2)
iByte = Val("&h" + s)
b.WriteByte(iByte)
Next k
Next c
b.Close
End if
End Sub


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Thu Jul 28, 2011 9:58 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
to make this work on a Mac you might want to look into your filename structures.... "E:\xxxx" won't work

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Thu Jul 28, 2011 3:05 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Could I still use a "./MainWindow.nib" for the current or same directory? Or would it be wiser to use the FolderParent/Child options of the Folder object for file locations on Mac? So far the interface builder and such work great, kind of like the RB of iOS programming :-) but I'm use to c/c++ code, figure this project could make the app development for iOS much faster and more available OS wise... The compiler translates a self-made language(almost the same as RB/vb) into pure C-Object and compiles with a platform ARM GCC 4.2, to ensure no problems if cocoa or other feature SDKs are added. I've written a number of compilers and assemblers, and IDE builders from scratch in pure C, JavaScript/query, python n some others... But I'm still getting use to this RAD programming.. For me a notepad, terminal prompt, and a few header files work much quicker..:-p

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Thu Jul 28, 2011 3:35 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
btw, code works great! and yes ./ does work mac :-) I will post updates or any more questions here as I complete the project as well as the finished source and binaries :-)

THANK YOU FOR THE CODE AND HELP! YOUR'RE AWESOME!

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Sat Jul 30, 2011 9:50 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Ok, so now I'm stumped on using RB to create a folder...the .parent and .child have me confused and ive combed multiple resources. in VB one can simply use mkdir(destination).

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Sat Jul 30, 2011 9:56 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
simulanics wrote:
Ok, so now I'm stumped on using RB to create a folder...the .parent and .child have me confused and ive combed multiple resources. in VB one can simply use mkdir(destination).


Ive tried

Dim f as folderitem
f = getfolderitem("./")
f.child("temp").CreateAsFolder

to create a "temp" folder in the base application directory...
it works for windows, it works for mac...it doesn't work for linux...
am I missing something...

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Sat Jul 30, 2011 10:51 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
sorry for all the posts, but I'm sure they may help someone else... I have figured out everything..there was an error in the #if...#endif targeting for OS's

now my only true problem is implementing a simple cross-platform zip capability for zipping a single directory and all subdirectories and sub-files beneath it :-(

the compiler is about 90% complete at this point...

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Sun Jul 31, 2011 1:20 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
Quote:
now my only true problem is implementing a simple cross-platform zip capability for zipping a single directory and all subdirectories and sub-files beneath it


There are a few cross platform zip utilities around.
I use the one provided by Thomas Tempelmann
http://www.tempel.org/RB/ZipPackage

Its free in the basic form, and only $35 to unlock a nifty feature called ZipFolderItem
The class is all you need in OSX, while for Windows you need to track down the zlib all (free to distribute) and bundle that with your app.


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Sun Jul 31, 2011 4:20 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
kermit wrote:
Quote:
now my only true problem is implementing a simple cross-platform zip capability for zipping a single directory and all subdirectories and sub-files beneath it


There are a few cross platform zip utilities around.
I use the one provided by Thomas Tempelmann
http://www.tempel.org/RB/ZipPackage

Its free in the basic form, and only $35 to unlock a nifty feature called ZipFolderItem
The class is all you need in OSX, while for Windows you need to track down the zlib all (free to distribute) and bundle that with your app.



I have tried this :-) trying to utilize zipmbs and have the app automatically "installing" zlib if not found on windows in volume(0) system folder. I can use zipmbs to class.creatfile("zipname.zip") and add single files.. But as far as recursing.. I'm experiencing files... I've played with the compression examples and keep getting an error with the item property (which is an array) :-( any code would help.. This is pretty much the only thing preventing the project from being 100% complete as iPhone/iPad/iPod touch bundles are zip folders with an "ipa" extension instead of zip. I have managed to bypass apples proprietary coding which prevents Linux and windows development without huge packages like dragonsdk or marmalade which depends on visual studio.. I've managed to use direct binary to create a vb/RB of iOS development.. Basically an assembler which is still able to be code signed with a valid apple keychain... The vb version works great and I've submitted quite a few apps to the i store without apple knowing none the wiser that the code wasn't compiled by gcc via Xcode :-) but RB has been quite a rough transition in some spots :-( but no sdk is required or comilers and linkers.. Just one program that just under 7 mb compiled and 3 mb if compressed with UPX. So I definitely appreciate all your help.

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Sat Oct 22, 2011 9:30 am 
Offline
User avatar

Joined: Mon Jun 20, 2011 11:54 am
Posts: 26
WOW! :shock:
This project looks awesome, can't wait to test it!
I hope you solve the problem soon.
Good luck! :wink:

_________________
"Some Day Everything Will Be Digital"
Caronte.

Web: nicodigital.com


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Sat Oct 22, 2011 9:59 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
OK.. that was July, and nothing since?

Quote:
I've played with the compression examples and keep getting an error with the item property (which is an array) any code would help.


And the lines of code that didn't work are...?


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Sat Oct 22, 2011 10:24 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
The compiler works perfect... Am adding the ios5 features to the IDE at the moment... Sorry for the delay... Has been more of a hobby to prove a point than anything :-) will post an update soon.

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Sat Oct 22, 2011 12:44 pm 
Offline
User avatar

Joined: Mon Jun 20, 2011 11:54 am
Posts: 26
Good news!
If you need a beta tester before launch the app, tell me :wink:

_________________
"Some Day Everything Will Be Digital"
Caronte.

Web: nicodigital.com


Top
 Profile  
 
 Post subject: Re: iOS Compiler from VB to RB
PostPosted: Sat Oct 22, 2011 2:34 pm 
Offline

Joined: Tue Aug 14, 2007 8:44 am
Posts: 583
Absolutely looking forward to this!

Also: How will it work?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 62 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group