Am Mittwoch, den 25.11.2009, 00:27 +1100 schrieb
nospam.nospam.nos...@gmail.com:
> Matteo Lisi wrote:
> >   Hi !
> > 
> >   The first line:
> > #!/usr/bin/ gbs2
> > 
> >   it's a typing error
> >   the right line is:
> > #!/usr/bin/gbs2
> > 
> >   Thanks Charlie , but the problem , unfortunatly is not the space !
> 
> Could the problem be some other typing error?

Salut,

1.)------ full call --------

:~/gambas/2/f3/scriptTest$ /usr/local/bin/gbs2 -c
~/gambas/2/f3/scriptTest/matteo.ga2script
gbs2: warning: cannot find component dbreportviewer2 required by
DBReportDesigner2
CComponent.CalcSortKey.171: #13: Null object
0: CComponent.CalcSortKey.171
1: CComponent.SortComponents.201
2: CComponent._init.123
3: MMain.MakeVirtualProject.180
4: MMain.Main.83

I'v no idea what, and why that gbs2: warning.
The component exists as User-Component, and of course it has nothing to
do with the script

2.)----- my gbs2 version [rev 2429] ------------------------

:~/gambas/2/f3/scriptTest$ /usr/local/bin/gbs2  -V
2.14.0

3.)------ after a chmod +x and changing to #!/usr/local/bin/gbs2 ------

:~/gambas/2/f3/scriptTest$ ./matteo.ga2script
./matteo.gbs: line 3: syntax error near unexpected token `('
./matteo.gbs: line 3: `FUNCTION GetUsedMemory() AS Integer'

perhaps Benoit or Fabien have a Idea!


-- 
Amicalement
Charlie
#!/usr/local/bin/gbs2

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())
                                        
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to