The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
Hello
It's my first project with Netduino.
Really when i start to think about develop with VBNET i was very happy.
But now, i am thinking : that is not than good like sound...
my last problem is ...
i'm trying to convert a single char to integer with :
Dim words As String() = linea.Split(","c)
Dim HoraInicio As New System.DateTime(1900, 1, 1,ctype(words(0),integer), ctype(words(1),integer), 0)
i was trying too with
a=cint(words(0))
and return an error.....
what am i doing bad??
is too dificoult convert a single string to integer??
sorry for my english.
thanks in advance.
Hi rlcobos and welcome to the boards!
Could you post a full code, perhaps something would be wrong with the input value.
I normally use int.Parse(stringvalue) by the way.
Hi,
thanks for your quickly reply....
my code is...
'voy separando las lineas, para procesarlas.
Try
' Create an instance of StreamReader to read from a file.
Using sr As StreamReader = New StreamReader("\SD\datos.txt")
Dim linea As String
' Read and display the lines from the file until the end
' of the file is reached.
Do
linea = sr.ReadLine()
Dim words As String() = linea.Split(","c)
Debug.Print(func.Valor(words(0).ToString))
Dim HoraInicio As New System.DateTime(1900, 1, 1, func.Valor(words(0).ToString), func.Valor(words(1).ToString), 0)
Dim HoraFin As New System.DateTime(1900, 1, 1, func.Valor(words(2).ToString), func.Valor(words(3).ToString), 0)
Dim Dia As Integer = func.Valor(words(4).ToString)
Insertar(fCol, HoraInicio, HoraFin, Dia)
Loop Until linea Is Nothing
sr.Close()
End Using
Catch E As Exception
' Let the user know what went wrong.
Debug.Print("The file could not be read:")
Debug.Print(E.Message)
End Try
I have make a new function for convert the string to value
is func.valor....
the original code was...
Dim HoraInicio As New System.DateTime(1900, 1, 1, cInt(words(0).ToString), cInt(words(1).ToString), 0)
and i have try too with...
Dim HoraInicio As New System.DateTime(1900, 1, 1, ctype(words(0).ToString,integer), ctype(words(1).ToString,integer), 0)
thanks, I supouse , i will ask a lot of question from today......
thanks
bye
Dim Hours As String = "5"
Dim Minutes As String = "23"
Dim MyDate As New DateTime(1900, 1, 1, CInt(Hours), CInt(Minutes), 0)
Debug.Print(MyDate.ToString)
This code works fine for me and produces the expected result: 01/01/1900 05:23:00
So what are the values of words(0) and words(1) and what is the error?
Hi,
At the first moment, thanks for your time....
I have tryed with
try
Dim a As String = "10"
Dim h As New System.DateTime(1900, 1, 1, CInt(a), CInt(a), 0)
catch e as exception
Debug.print e.message
end try
and i have the next in debug...
Exception was thrown: System.NotImplementedException
I work with
DeviceInfo:
HAL build info: 4.2.0.0, Netduino Plus (v4.2.0.0 RC3) by Secret Labs LLC
OEM Product codes (vendor, model, SKU): 34, 177, 4097
Serial Numbers (module, system):
00000000000000000000000000000000
0000000000000000
Solution Build Info: 4.2.0.0, Netduino Plus (v4.2.0.0 RC3) by Secret Labs LLC
AppDomains:
Assemblies:
mscorlib,4.2.0.0
Microsoft.SPOT.Native,4.2.0.0
Microsoft.SPOT.Hardware,4.2.0.0
Microsoft.SPOT.Net,4.2.0.0
System,4.2.0.0
Microsoft.SPOT.Hardware.SerialPort,4.2.0.0
Microsoft.SPOT.IO,4.2.0.0
System.IO,4.2.0.0
Microsoft.SPOT.Hardware.Usb,4.2.0.0
Microsoft.SPOT.Hardware.PWM,4.2.0.0
SecretLabs.NETMF.Hardware,4.2.0.0
SecretLabs.NETMF.Diagnostics,4.2.0.0
Without SD Card,1.0.0.0
Microsoft.VisualBasic,1.0.0.0
classFecha,1.0.0.0
I have solved this problem with an function in c#, but may be good i can found a better solution.s
thanks in advance.