[Gambas-user] using gambas as a scripting language ?

abom at ...1919... abom at ...1919...
Mon Jun 2 18:25:20 CEST 2008


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 ^^ ?! 










More information about the User mailing list