Le 15/07/2017 à 20:49, Tony Morehen a écrit :
Did you try Benoit's suggestion:

Public Sub Main()

   Dim sIn as String
   Dim sOut as String

   sIn = File.Load("/home/fernando/temp/deah001.dhn")
   sOut = Add11(sIn)
   File.Save("/home/fernando/temp/deah001.11Added.dhn", sOut)

End

Public Sub Add11(InputString as String) as String
   Dim bArray As Byte[]
   Dim String11 As String
   Dim i As Integer

   bArray = Byte[].FromString(InputString)
   For i = 0 To bArray.Max
     bArray[i] += 11
   Next
  Return bArray.ToString
End



Just a remark:

You don't have to use Byte[].FromString.

You can use the Bute[].Read() method instead, to load the file directly into the array. You save an intermediate string that way.

Regards,

--
Benoît Minisini

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to