Click here to Skip to main content
14,241,167 members

.NET Framework

 
AnswerRe: MSIL: Are there practical uses for writing MSIL code that can't be done in C# Pin
Richard Deeming18-Feb-19 1:19
mveRichard Deeming18-Feb-19 1:19 
QuestionTask based asyn Pin
anilkumar198612-Feb-19 18:50
memberanilkumar198612-Feb-19 18:50 
AnswerRe: Task based asyn Pin
Wastedtalent12-Feb-19 21:21
professionalWastedtalent12-Feb-19 21:21 
GeneralRe: Task based asyn Pin
anilkumar198612-Feb-19 21:37
memberanilkumar198612-Feb-19 21:37 
GeneralRe: Task based asyn Pin
Wastedtalent12-Feb-19 21:48
professionalWastedtalent12-Feb-19 21:48 
GeneralRe: Task based asyn Pin
anilkumar198612-Feb-19 22:52
memberanilkumar198612-Feb-19 22:52 
GeneralRe: Task based asyn Pin
anilkumar198613-Feb-19 1:23
memberanilkumar198613-Feb-19 1:23 
Questionstatement is not valid n a namespace Pin
Member 1384753912-Feb-19 8:07
memberMember 1384753912-Feb-19 8:07 
I am very new to coding and had to write a code for my college project referring to a YouTube video. So far everything I have written is fine but only one error seems to repeat itself which is: 'Statement is not valid n a namespace'
Please help..
Option Explicit On
Dim BUFFERSS
Private Declare Sub Sleep Lib "kernel132" (ByVal dwMilliseconds As Long)
Dim message As Integer<small><big><pre>
Dim search As String
Dim strTest As String
Dim user1 As Integer
Dim user2 As Integer

Dim time1 As Integer
Dim time2 As Integer

Dim mins As Integer
Dim secs As Integer

Dim teacherflag As Integer

Dim sflag1 As Integer ' Student 1 flag
Dim sflag2 As Integer ' Student 2 flag
Dim sflag3 As Integer ' Student 3 flag

Dim msending As Integer ' message sending flag
Dim absent1 As Integer
Dim absent2 As Integer
Dim absent3 As Integer

Dim absentflag As Integer

Dim flag1 As Integer
Dim flag2 As Integer
Dim flag3 As Integer

Dim counter As Integer

Private Sub Form_Load()
mins = 0
Timer3.Enabled = False
teacherflag = 0
sflag1 = 0
sflag2 = 0
sflag3 = 0
msending = 0
absent1 = 0
absent2 = 0
absent3 = 0

absentflag = 0

flag1 = 0
flag2 = 0
flag3 = 0

PerformanceCounter = 0
'MSComm1.Settings = "9600,n,8,1" 'Change this with the Baud rate of your modem (The one that you use with the Hyper terminal)
'MSComm1.CommPort = 10
'MSComm1.PortOpen = True

With MSComm1
    .CommPort = 3
    .Settings = "9600,N,8,1"
    .Handshaking = comRTS
    .RTSEnable = True
    .DTREnable = True
    .Rthreshold = 1
    .Sthreshold = 1
    .InputMode = comInputModeText
    .InputLen = 0
    .PortOpen = True    'Must be the last
End With

End Sub

Private Sub Timer1_Timer()
txtrec.Text = MSComm1.Input
SearchDirectionHint = txtrec.Text
If (InStr(search, "teacher") And (teacherflag = 0)) Then  ' when the teacher will swipe the RFID card word teacher will be 
    Check3.Value = 1
    Timer3.Enabled = True   'timer3 is used for timing mins and secs
    teacherflag = 1
    Timer4.Enabled = True
End If

If (InStr(search, "stu1") And (sflag1 = 0) And mins < 6) Then   'then the student 1 will be marked present
    Check4.Value = 1
    sflag1 = 1
End If

If (InStr(search, "stu2") And (sflag1 = 0) And mins < 6) Then   'then the student 2 will be marked present
    Check5.Value = 1
    sflag2 = 1
End If

If (InStr(search, "stu3") And (sflag1 = 0) And mins < 6) Then   'then the student 3 will be marked present
    Check6.Value = 1
    sflag3 = 1
End If

End Sub

Private Sub Timer2_Timer()
Label5.Caption = TimeOfDay
End Sub

Private Sub Timer3_Timer()
secs = secs + 1
Label7.Caption = Secs
If secs > 59 Then
    secs = 0
    mins = mins + 1
    Label3.Caption = mins
End If

End Sub

Private Sub Timer4_Timer()
'sending message to students to let them know that the teacher has arrived.
'in the controller program each and every user will have its own message sending function in which his number will be specified
PerformanceCounter = PerformanceCounter + 1
Label3.Caption = PerformanceCounter
If ((teacherflag = 1) And ((PerformanceCounter > 10) And (PerformanceCounter < 20)) And (Check8.Value = 0)) Then
Check8.Value = 1
End If
If ((teacherflag = 1) And ((PerformanceCounter > 30) And (PerformanceCounter < 40)) And (Check9.Value = 0)) Then
    Check9.Value = 1
End If

If ((teacherflag = 1) And ((PerformanceCounter > 50) And (PerformanceCounter < 60)) And (Check10.Value = 0)) Then
    Check10.Value = 1
End If

If ((teacherflag = 1) And ((PerformanceCounter > 90) And (PerformanceCounter < 120)) And (Check12.Value = 0)) Then  'this when checked means all message sent
    Check12.Value = 1
End If

'check box for parents messages

If ((Check12.Value = 1) And ((PerformanceCounter > 300) And (PerformanceCounter < 320) And (check4.Value = 0))) Then    'This when checked means all message
    Check13.Value = 1
End If

If ((Check12.Value = 1) And ((PerformanceCounter > 330) And (PerformanceCounter < 350) And (check5.Value = 0))) Then    'This when checked means all message
    Check14.Value = 1
End If

If ((Check12.Value = 1) And ((PerformanceCounter > 370) And (PerformanceCounter < 380) And (check6.Value = 0))) Then    'This when checked means all message
    Check15.Value = 1
End If

If ((Check12.Value = 1) And ((PerformanceCounter > 390) And (PerformanceCounter < 400) And (check7.Value = 0))) Then 'This when checked means all message
Check16.Value = 1
End If

'**************************************************************************
If ((Check8.Value = 1) And (flag1 = 0)) Then
MSComm1.Output = "a"
flag1 = 1
End If

If ((Check9.Value = 1) And (flag2 = 0)) Then
MSComm1.Output = "b"
flag2 = 1
End If

If ((Check10.Value = 1) And (flag3 = 0)) Then
MSComm1.Output = "c"
flag3 = 1
End If

'message sending to their parents

If ((Check13.Value = 1) And (Absent1 = 0)) Then
MSComm1.Output = "l"
Absent1 = 1
End If

If ((Check14.Value = 1) And (Absent2 = 0)) Then
MSComm1.Output = "m"
Absent2 = 1
End If

If ((Check15.Value = 1) And (Absent3 = 0)) Then
MSComm1.Output = "n"
Absent = 1
End If

End Sub


Sameer

AnswerRe: statement is not valid n a namespace Pin
Richard Deeming12-Feb-19 10:05
mveRichard Deeming12-Feb-19 10:05 
GeneralRe: statement is not valid n a namespace Pin
Member 1384753913-Feb-19 5:37
memberMember 1384753913-Feb-19 5:37 
QuestionMocking a Service call in my Unit Tests Pin
simpledeveloper8-Feb-19 7:31
membersimpledeveloper8-Feb-19 7:31 
AnswerRe: Mocking a Service call in my Unit Tests Pin
Gerry Schmitz8-Feb-19 10:46
mveGerry Schmitz8-Feb-19 10:46 
GeneralRe: Mocking a Service call in my Unit Tests Pin
simpledeveloper8-Feb-19 10:59
membersimpledeveloper8-Feb-19 10:59 
GeneralRe: Mocking a Service call in my Unit Tests Pin
simpledeveloper11-Feb-19 8:29
membersimpledeveloper11-Feb-19 8:29 
GeneralRe: Mocking a Service call in my Unit Tests Pin
Gerry Schmitz13-Feb-19 5:40
mveGerry Schmitz13-Feb-19 5:40 
QuestionNot able to read the Detail property of Exception, when it is shown in the Quick Watch Pin
simpledeveloper4-Feb-19 12:25
membersimpledeveloper4-Feb-19 12:25 
AnswerRe: Not able to read the Detail property of Exception, when it is shown in the Quick Watch Pin
Dave Kreskowiak4-Feb-19 14:04
mveDave Kreskowiak4-Feb-19 14:04 
GeneralRe: Not able to read the Detail property of Exception, when it is shown in the Quick Watch Pin
simpledeveloper8-Feb-19 7:15
membersimpledeveloper8-Feb-19 7:15 
GeneralRe: Not able to read the Detail property of Exception, when it is shown in the Quick Watch Pin
Dave Kreskowiak8-Feb-19 8:49
mveDave Kreskowiak8-Feb-19 8:49 
GeneralRe: Not able to read the Detail property of Exception, when it is shown in the Quick Watch Pin
simpledeveloper8-Feb-19 9:44
membersimpledeveloper8-Feb-19 9:44 
GeneralRe: Not able to read the Detail property of Exception, when it is shown in the Quick Watch Pin
Pete O'Hanlon8-Feb-19 10:37
protectorPete O'Hanlon8-Feb-19 10:37 
GeneralRe: Not able to read the Detail property of Exception, when it is shown in the Quick Watch Pin
Dave Kreskowiak8-Feb-19 10:44
mveDave Kreskowiak8-Feb-19 10:44 
GeneralRe: Not able to read the Detail property of Exception, when it is shown in the Quick Watch Pin
simpledeveloper8-Feb-19 10:52
membersimpledeveloper8-Feb-19 10:52 
AnswerRe: Not able to read the Detail property of Exception, when it is shown in the Quick Watch Pin
Richard MacCutchan4-Feb-19 22:05
protectorRichard MacCutchan4-Feb-19 22:05 
GeneralRe: Not able to read the Detail property of Exception, when it is shown in the Quick Watch Pin
simpledeveloper8-Feb-19 7:51
membersimpledeveloper8-Feb-19 7:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.