[Gambas-devel] Process Stream (all 64-bit Revision)

scatman scatman at ...571...
Sun Jan 27 16:16:16 CET 2008


Hello,


i think i have found a nother Bug

I am write a little Phone-app...

#### Code for Reading from phone. ####

PUBLIC SUB treeViewOK_Click()

SELECT CASE treeView1.Key

  CASE "Save" 'save the Contact to disk
    saveTelNr()

  CASE "SM" 'read phonememory from phone
    ColumnView1.Clear
    $hProcess = EXEC ["gammu", "--getmemory", "SM", "1", "150", "-nonempty"] 	
FOR READ WRITE
    object.Attach($hProcess, ME, "Contact")

End 

#### Code to Sort the Entries. ####

PUBLIC SUB Contact_Read()

' load via exec gammu --getmemory the Contact

DIM Name AS String
DIM memory AS String
DIM location AS String
DIM entrie AS Integer

WHILE NOT Eof(LAST)
  LINE INPUT #LAST, PhoneData

    ' PhoneData = Conv(PhoneData, system.Charset, desktop.Charset)
    
    PRINT PhoneData
    
    IF Mid$(PhoneData, 12, 8) = "Location" THEN
      location = Right$(PhoneData, 2)
    END IF
     
    IF Left$(PhoneData, 4) = "Name" THEN
      name = Mid$(PhoneData, InStr(PhoneData, ":") + 3, - 1)
    END IF

    IF Left$(PhoneData, 7) = "General" THEN
      number = Mid$(PhoneData, (InStr(PhoneData, ":")) + 3, -1)
    END IF
     
    IF Left$(PhoneData, 6) = "Memory" THEN
      memory = Mid$(PhoneData, (InStr(PhoneData, "Memory")) + 7, 2)
    END IF
    
     IF location <> NULL THEN 
     IF entrie <> Val(location) THEN  
       ColumnView1.Add(Val(location), name)
       Columnview1[Val(location)][1] = number
       ColumnView1[Val(location)][2] = memory
       ColumnView1[Val(location)][3] = location
       label6.Text = Index
       entrie = Val(location)
     END IF
     END IF
        
WEND 

END


Now my Problem.
The Stream is Broken.

#### gammu via console gives me this ###

Memory ME, Location 1
General number       : "+4912345678"
Name                 : "Mr. Mustermann/M"

Memory ME, Location 2
General number       : "012345678"
Name                 : "Firma/W"

and so on.


the Stream inside Gambas looks

Memory ME, Location 1
number       : "+4912345678"
Name                 : "Mr. Mustermann/M"

Memory ME, Location 2
General number       : "012345678"
Name                 : "Firma/W"

But every 10 Locations the Stream is Broken

Memory ME, Location 11
General number    
   : "+4923456789"
Name                 : "DIETER/M"

from 12 to 20 is everything OK.
 
Memory ME, Location 21
General number       : "+49000000000"
Name          
       : "M. Rosenberg/H"

If you need my Project, i can send it.

thanks




More information about the Devel mailing list