|
| Author |
Message |
Cash
Joined: 04 Oct 2007 Posts: 3
|
Posted: Tue Oct 24, 2006 3:28 am Post subject: Syntax help |
|
|
I have a problem when compiling following code. The message i get is: "NEXT
without FOR". It's on the last NEXT the compile-error appears.
Could anyone please help me and let me know how I should write the code
instead.
Thanx in advance.
For intCC2 = 1 To 10
TAGNAMN_CC2(intCC2) = "CC2_SMS" & intCC2
eda_err = eda_get_one_float(Node, TAGNAMN_CC2(intCC2), Field,
fValue_CC2(intCC2))
If fValue_CC2(intCC2) = 1 And Not cycle_CC2(intCC2) Then
cycle_CC2(intCC2) = True
RunLog ("Customer Care 2 = CC2 " & intCC2 & " aktiv")
List1.AddItem "Customer Care 2 = CC2 " & intCC2 & " aktiv " &
Time(Now)
'Sänder ut larmet via SENDMAIL
For intCC2Tel = 1 To intAntalTelCC2
temp_CC2(intCC2) = Shell("d:\Mail\Sendmail /I /" &
TelNrCC2(intCC2Tel) & " /" & TextCC2(intCC2))
Wait 0.6
Next
ElseIf fValue_CC2(intCC2) = 0 Then
cycle_CC2(intCC2) = False
Next
Archived from group: microsoft>public>vb>syntax |
|
| Back to top |
|
 |
Bob Butler
Joined: 04 Oct 2007 Posts: 1325
|
Posted: Mon Oct 23, 2006 8:49 pm Post subject: Re: Syntax help |
|
|
"Cash" wrote in message%g.20718$E02.8349@newsb.telia.net
> I have a problem when compiling following code. The message i get is:
"NEXT
> without FOR". It's on the last NEXT the compile-error appears.
> Could anyone please help me and let me know how I should write the
> code instead.
> For intCC2 = 1 To 10
> If fValue_CC2(intCC2) = 1 And Not cycle_CC2(intCC2) Then
> ElseIf fValue_CC2(intCC2) = 0 Then
> cycle_CC2(intCC2) = False
End If
> Next
--
Reply to the group so all can participate
VB.Net: "Fool me once..." |
|
| Back to top |
|
 |
Ken Halter
Joined: 04 Oct 2007 Posts: 4150
|
Posted: Tue Oct 24, 2006 1:19 am Post subject: Re: Syntax help |
|
|
"Cash" wrote in message %g.20718$E02.8349@newsb.telia.net...
>I have a problem when compiling following code. The message i get is: "NEXT
>without FOR". It's on the last NEXT the compile-error appears.
> Could anyone please help me and let me know how I should write the code
> instead.
>
> Thanx in advance.
Since others spotted the problem, I'll just add... VB *usually* shows the
correct error... but, things like End If, Loop, Next and a few others are
basically "end of block" keywords. When they're missing, all bets are off,
when it comes to VBs ability to tell you what the real problem is.
Another type of error VB has a hard time with is "missing references"
errors. Sometimes the correct lib name shows, other times it doesn't. Just
check for items marked "missing" in the references dialog.
--
Ken Halter - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm |
|
| Back to top |
|
 |
Jan Hyde
Joined: 04 Oct 2007 Posts: 1211
|
Posted: Tue Oct 24, 2006 1:30 pm Post subject: Re: Syntax help |
|
|
"Cash" 's wild thoughts were released on
Mon, 23 Oct 2006 23:28:56 GMT bearing the following fruit:
>I have a problem when compiling following code. The message i get is: "NEXT
>without FOR". It's on the last NEXT the compile-error appears.
>Could anyone please help me and let me know how I should write the code
>instead.
>
>Thanx in advance.
>
>
Get a code indentor - makes finding these things a lot
easier.
Jan Hyde (VB MVP)
--
A guy walks into the psychiatrist wearing only clingfilm for shorts.
The shrink says, "Well, I can clearly see you're nuts." |
|
| Back to top |
|
 |
Cash
Joined: 04 Oct 2007 Posts: 3
|
Posted: Wed Oct 25, 2006 2:28 am Post subject: Re: Syntax help |
|
|
THANX all for your help.
//Kashif
"Cash" skrev i meddelandet %g.20718$E02.8349@newsb.telia.net...
>I have a problem when compiling following code. The message i get is: "NEXT
>without FOR". It's on the last NEXT the compile-error appears.
> Could anyone please help me and let me know how I should write the code
> instead.
>
> Thanx in advance.
>
>
>
> For intCC2 = 1 To 10
> TAGNAMN_CC2(intCC2) = "CC2_SMS" & intCC2
> eda_err = eda_get_one_float(Node, TAGNAMN_CC2(intCC2), Field,
> fValue_CC2(intCC2))
>
> If fValue_CC2(intCC2) = 1 And Not cycle_CC2(intCC2) Then
> cycle_CC2(intCC2) = True
> RunLog ("Customer Care 2 = CC2 " & intCC2 & " aktiv")
> List1.AddItem "Customer Care 2 = CC2 " & intCC2 & " aktiv " &
> Time(Now)
>
> 'Sänder ut larmet via SENDMAIL
> For intCC2Tel = 1 To intAntalTelCC2
> temp_CC2(intCC2) = Shell("d:\Mail\Sendmail /I /" &
> TelNrCC2(intCC2Tel) & " /" & TextCC2(intCC2))
> Wait 0.6
> Next
>
> ElseIf fValue_CC2(intCC2) = 0 Then
> cycle_CC2(intCC2) = False
> Next
>
> |
|
| Back to top |
|
 |
Bob O`Bob
Joined: 04 Oct 2007 Posts: 1456
|
Posted: Thu Oct 26, 2006 3:11 am Post subject: Re: Syntax help |
|
|
Jan Hyde wrote:
>
> Get a code indentor - makes finding these things a lot
> easier.
>
On and off, I've found myself looking for a good one, but
never quite felt like writing one.
Can you recommend any?
Bob
-- |
|
| Back to top |
|
 |
Jan Hyde
Joined: 04 Oct 2007 Posts: 1211
|
Posted: Thu Oct 26, 2006 12:51 pm Post subject: Re: Syntax help |
|
|
Bob O`Bob 's wild thoughts were
released on Wed, 25 Oct 2006 23:11:57 -0700 bearing the
following fruit:
>Jan Hyde wrote:
>>
>> Get a code indentor - makes finding these things a lot
>> easier.
>>
>
>On and off, I've found myself looking for a good one, but
>never quite felt like writing one.
>
>Can you recommend any?
>
I use Smart Indentor
http://www.oaltd.co.uk/Indenter/Default.htm
While it doesn't do everything I'd like it to it's served me
well over the years, particulary when you have maintain code
that hasn't been indented. In fact when I'm frantically
writting code I don't stop to indent and then use this.
Jan Hyde (VB MVP)
--
"I'm going to end it all," Sue sighed. (Kegel Archives) |
|
| Back to top |
|
 |
Bob O`Bob
Joined: 04 Oct 2007 Posts: 1456
|
Posted: Fri Oct 27, 2006 2:11 am Post subject: Re: Syntax help |
|
|
Jan Hyde wrote:
> Bob O`Bob 's wild thoughts were
> released on Wed, 25 Oct 2006 23:11:57 -0700 bearing the
> following fruit:
>
>> Jan Hyde wrote:
>>> Get a code indentor - makes finding these things a lot
>>> easier.
>>>
>> On and off, I've found myself looking for a good one, but
>> never quite felt like writing one.
>>
>> Can you recommend any?
>>
>
> I use Smart Indentor
>
> http://www.oaltd.co.uk/Indenter/Default.htm
>
> While it doesn't do everything I'd like it to it's served me
> well over the years, particulary when you have maintain code
> that hasn't been indented. In fact when I'm frantically
> writting code I don't stop to indent and then use this.
Interesting.
Since test & debug is an integral part of "writing" for me,
it would take /longer/ to write poorly formatted code.
Bob
-- |
|
| Back to top |
|
 |
Jan Hyde
Joined: 04 Oct 2007 Posts: 1211
|
Posted: Fri Oct 27, 2006 12:45 pm Post subject: Re: Syntax help |
|
|
Bob O`Bob 's wild thoughts were
released on Thu, 26 Oct 2006 22:11:25 -0700 bearing the
following fruit:
>Jan Hyde wrote:
>> Bob O`Bob 's wild thoughts were
>> released on Wed, 25 Oct 2006 23:11:57 -0700 bearing the
>> following fruit:
>>
>>> Jan Hyde wrote:
>>>> Get a code indentor - makes finding these things a lot
>>>> easier.
>>>>
>>> On and off, I've found myself looking for a good one, but
>>> never quite felt like writing one.
>>>
>>> Can you recommend any?
>>>
>>
>> I use Smart Indentor
>>
>> http://www.oaltd.co.uk/Indenter/Default.htm
>>
>> While it doesn't do everything I'd like it to it's served me
>> well over the years, particulary when you have maintain code
>> that hasn't been indented. In fact when I'm frantically
>> writting code I don't stop to indent and then use this.
>
>
>Interesting.
>Since test & debug is an integral part of "writing" for me,
>it would take /longer/ to write poorly formatted code.
>
By frantically writting code, I'm talking about simple stuff
that I don't even need to stop to think about, I know
exactly what I need to write. I then stop, indent, test,
carry on. I test every routine I write before I move onto
the next one. Another reason I need to do it is because I
use Comic Sans as my code window font, what looks correctly
indented to me isn't to others, so I use the indenter
afterwards to be, sure since others have to work on the code
too.
J
>
> Bob
Jan Hyde (VB MVP)
--
Did you hear about the guy who blamed arithmetic for his divorce?
His wife put two and two together.
(Art. Moger) |
|
| Back to top |
|
 |
Bob Butler
Joined: 04 Oct 2007 Posts: 1325
|
Posted: Fri Oct 27, 2006 10:25 am Post subject: Re: Syntax help |
|
|
"Jan Hyde" wrote in message@4ax.com
> By frantically writting code, I'm talking about simple stuff
> that I don't even need to stop to think about, I know
> exactly what I need to write. I then stop, indent, test,
> carry on.
I'd have to work very hard at NOT doing the indenting even with quick
samples like the. I don't even notice that I'm typing it because it's so
automatic.
> I test every routine I write before I move onto
> the next one. Another reason I need to do it is because I
> use Comic Sans as my code window font, what looks correctly
> indented to me isn't to others,
I'll bet! http://bancomicsans.com/home.html
> so I use the indenter
> afterwards to be, sure since others have to work on the code
> too.
--
Reply to the group so all can participate
VB.Net: "Fool me once..." |
|
| Back to top |
|
 |
Jeff Johnson
Joined: 04 Oct 2007 Posts: 1327
|
Posted: Mon Oct 30, 2006 2:56 am Post subject: Re: Syntax help |
|
|
"Bob Butler" wrote in message %23GHA.1224@TK2MSFTNGP04.phx.gbl...
> http://bancomicsans.com/home.html
HAHAHAHA!! The link for the Comic Sans Appreciation Society gives a 404! How
appropriate.
|
|
| Back to top |
|
 |
|