[Gambas-user] using gambas as a scripting language ?
Benoit Minisini
gambas at ...1...
Mon Jun 2 20:10:02 CEST 2008
On lundi 02 juin 2008, abom at ...1919... wrote:
> hello everybody ,
> i want to use gambas as a scripting language like ruby for example
> i have do what was said in the documentaion :
>
>
> #!/usr/bin/env 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())
>
>
>
> then saving it as file.gambas , runnign it ./file.gambas
>
> but it gives me :
>
>
> root at ...1920...:/home/abom# chmod +x ./gb.gambas
> root at ...1920...:/home/abom# ./gb.gambas
> /usr/bin/env: gbs2: No such file or director
>
>
> any help ^^ ?!
>
This is a requirement for a Gambas installation: gbx2 and gbs2 must be in the
PATH, otherwise executables and scripts will not work.
Or maybe gbs2 was not installed? Please give more information about what you
did to install Gambas.
Regards,
--
Benoit Minisini
More information about the User
mailing list