Jump to content

PureAutoIt machine code compiler small executable


ghost911
 Share

Recommended Posts

StringSplit ( "string", "" )

If you use an empty string "" for the delimiters, each character will be returned as an element.

Procedure StrToArrLetter(Array Arr.s{1}(1), String$)
    Protected LenStr, i
    LenStr = Len(String$)
    If LenStr
        ReDim Arr(LenStr - 1)
        PokeS(Arr(), String$, -1, #PB_String_NoZero)
    EndIf
EndProcedure

StringSplit ( "string", " " )

Procedure StrToArr(Array Arr.s(1), String$, Sep$ = " ")
    Protected CountSep, n
    CountSep = CountString(String$ , Sep$)
    If CountSep = 0
        ReDim Arr(1)
        Arr(1) = String$
    Else
        ReDim Arr(CountSep+1)
        For n = 1 To CountSep+1
            Arr(n) = StringField(String$, n, Sep$)
        Next
    EndIf
EndProcedure

StringFormat

ImportC "msvcrt.lib"
  swprintf(*s, Format.s, Param1=0, Param2=0, Param3=0, Param4=0)
EndImport

num1.l = 16049884
Buff.s{100}
swprintf(@Buff, "%06X", num1)
Debug Buff

StringTrimLeft

Procedure.s TrimLeft(String$, n)
    ;ProcedureReturn Right(String$, Len(String$) - n)
    ProcedureReturn Mid(String$, n+1)
EndProcedure

StringTrimRight

Procedure.s TrimRight(String$, n)
    ProcedureReturn Left(String$, Len(String$) - n)
EndProcedure

@ScriptDir =analog= GetPathPart(ProgramFilename())
@ScriptName =analog= GetFilePart(ProgramFilename())
@ScriptFullPath =analog= ProgramFilename()
@MyDocumentsDir =analog= GetUserDirectory(#PB_Directory_Documents)
@ProgramFilesDir =analog= GetUserDirectory(#PB_Directory_Programs)
@DesktopCommonDir  =analog= GetUserDirectory(#PB_Directory_Desktop)

Edited by AZJIO
Link to comment
Share on other sites

On 3/6/2019 at 11:33 PM, ghost911 said:

PureBasic Code : Executable Size : 119 kb with UPX Real Compiler ( Your source code is secure )

I think the code is not a hash sum, so it is always possible to study. He also gives commands to the OS, which means that he acts according to a scenario that the system recognizes. If you look at the functions for working with ListView, then in PureBasic there are only 15 functions, and in AutoIt3 - 150. In PureBasic, you have to write all the functions yourself. I can not write an analogue of the function _GUICtrlRichEdit_StreamFromVar. Although there is a curve example for the old version, but I can not adapt it. Therefore, in AutoIt3 you can program, and in PureBasic, watch how other people write programs.

Link to comment
Share on other sites

10 hours ago, Mobius said:

When I last used FB I found even the most basic of compiled binaries to be pretty chunky but it was some time ago, have they optimized the compiler these days?

....  I don't know, never done comparisons between the two (apart from the fact that one is free and the other is not), I have only seen some very speedy examples posted on this forum by @UEZ

https://www.autoitscript.com/forum/topic/185024-freebasic-graphical-examples-build-2018-07-10/

https://www.autoitscript.com/forum/topic/190642-ascii-art-kaleidoscope/?do=findComment&comment=1368827

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

16 hours ago, Chimp said:

....  I don't know, never done comparisons between the two (apart from the fact that one is free and the other is not), I have only seen some very speedy examples posted on this forum by @UEZ

https://www.autoitscript.com/forum/topic/185024-freebasic-graphical-examples-build-2018-07-10/

https://www.autoitscript.com/forum/topic/190642-ascii-art-kaleidoscope/?do=findComment&comment=1368827

 

... So you are asking why the op didn't use a language for their project that you don't really use yourself, ok.

No denying that both are perfectly capable languages but to eschew one over another purely based on one having a price tag and another not ... your choice I guess.

wtfpl-badge-1.png

Link to comment
Share on other sites

2 hours ago, Mobius said:

... So you are asking why the op didn't use a language for their project that you don't really use yourself, ok.

No denying that both are perfectly capable languages but to eschew one over another purely based on one having a price tag and another not ... your choice I guess.

Yes, since I don't know, I've asked. I have no claims to proselytize for FreeBasic vs PureBasic.
Since OP stated "( Disadvantage purebasic is paying you can not have all )"
I've just asked "why did not you opt for FreeBasic instead?" I've not say "You have to use FreeBasic instead!"
OP answered "purebasic is even more complete for interfaces and richer in function". That's all (sorry for the misunderstanding and the hijacking)

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

Time spent on learning the language and further use is hundreds of times more expensive. It takes me 3 days to work to buy PureBasic, but studying and addictive will take several months. It is more difficult to pay, as it is necessary to register on PayPal.

I do not think that it is necessary to make an AutoIt3 shell for PureBasic. It is better to make a table of function analogs in order to understand with the help of which function you can do the same things. I for example know the name of the function "Sleep", but I can not find its equivalent in the PureBasic help file, because the name is different.

Link to comment
Share on other sites

i just meant we needed to get him a better paying job, lol but yeah, the list would be nice. for me, it's not hard to pick up another language when you already know a few really well. but i did cut my teeth on Color Basic that shipped with my Tandy coco, then onto C, Java, and on from there. It's a lot of the same stuff really.

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...