[Gambas-user] exec also working as shell why?

PICCORO McKAY Lenz mckaygerhard at gmail.com
Fri Jan 10 17:38:17 CET 2020


i have a code where i want to pass content to main.. but i never raised the
content:
cadena only are filled with content after main raises end, why .. if i not
use shell?
i attached the project

i have a class and a module main, class are:

Public cadena As String = "ver"
Public linea As Collection
Private lineas As String[]

Public Sub Main()
Exec ["cat", "/etc/courier/authdaemonrc"] For Read As "Processo"
End


Public Sub Processo_Read()
Dim sLine As String
 Dim llavevalor As String[]
  Dim a As Integer
  sLine = Read #Last, -256
  cadena = cadena & sLine
  lineas = Split(sLine, gb.NewLine, "", True)
  For a = 0 To lineas.max
      If RInStr(lineas[a], "=") > 0 And RInStr(lineas[a], "#") < 1 Then
        llavevalor = Split(lineas[a], "=", "\"", False, False)
        linea.Add(llavevalor[1], llavevalor[0])
      Endif
  Next
End


SO in my Main modulo i have:

Public Sub Main()
Dim ver As New CourierConfigDetector
ver.Main
Print ver.cadena
End

cadena only are filled with content after main raises end, why .. if i not
use shell?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200110/5217dfeb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: courierauthtest-0.0.1.tar.gz
Type: application/gzip
Size: 11777 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200110/5217dfeb/attachment.gz>


More information about the User mailing list