[Gambas-user] Gambas script execution
Charlie Reinl
Karl.Reinl at ...9...
Tue Nov 24 13:47:21 CET 2009
Am Dienstag, den 24.11.2009, 11:54 +0100 schrieb Matteo Lisi:
>
> Hi !
>
> Finally I crosscompiled the gambas for ARM, and I have on my arm system
> the "gbc2" file
>
> I tried to execute the following script:
>
> /**********************************************************************/
> #!/usr/bin/ gbs2
>
> ' This script returns the memory really used by the system, the cache
> and swap being excluded.
>
> FUNCTION GetUsedMemory() AS Integer
>
> DIM sRes AS String
> DIM aRes AS String[]
> DIM cVal AS NEW Collection
> DIM sVal AS String
>
> EXEC ["cat", "/proc/meminfo"] TO sRes
>
> FOR EACH sVal IN Split(sRes, "\n", "", TRUE)
> aRes = Split(sVal, " ", "", TRUE)
> cVal[Left$(aRes[0], -1)] = CInt(aRes[1])
> NEXT
>
> RETURN cVal!MemTotal - cVal!MemFree - cVal!Buffers - cVal!Cached +
> cVal!SwapTotal - cVal!SwapFree - cVal!SwapCached
>
> END
>
> PRINT Subst("Used memory: &1 bytes", GetUsedMemory())
> /**********************************************************************/
>
> but the gbc2 return me:
>
> gbc: project file not found: /gambas_prove/.project
>
> Where I made mistake ?
>
Salut Matteo,
correct me if I'm wrong, I'v never dit anything with gambas-script.
You have a "gbc2" file, but your file-header says #!/usr/bin/ gbs2
( why that space )
That's what I'v remarked!
--
Amicalement
Charlie
More information about the User
mailing list