Problem with excuting 
Author Message
 Problem with excuting

Dear All,

Is my code corrected from the syntax for PBCC?

Here's my code

%TRUE   = -1
%FALSE  = Not %TRUE

Function PbMain()
    Dim iJaar       As Word
    Dim sAntw       As String
    Dim bSchrikkel  As Integer

    Do
        iJaar = CInt(Invoer("Geef een jaartal in : "))

        If (iJaar Mod 4 = 0) And (iJaar Mod 100 <> 0) Or (iJaar Mod
400 = 0) Then
            bSchrikkel = IsTrue
        Else
            BSchrikkel = IsFalse
        End If

        If bSchrikkel = IsTrue Then
            StdOut "Het jaar " & Str$(iJaar) & " is een schrikkeljaar"
        Else
            StdOut "Het jaar " & Str$(iJaar) & " is geen
schrikkeljaar"
        End If

        sAntw = Invoer("Wilt u nogmaals? (Y/N) ")
        WaitKey$

    Loop While sAntw = "J"

End Function

Function Invoer(ByVal sVraag As String) As String
    StdOut sVraag
    Function = StdIn Line sVraag
End Function



Thu, 09 Jun 2005 21:51:31 GMT  
 Problem with excuting
Hi,

I think you forgot to tell what your problem is... what error message do you
get, which line, etc..?

The code looks ok to me... just some remarks:

* I don't really understand why you declare constants %TRUE and %FALSE and
later only use the functions IsTrue and IsFalse... and I believe they should
be used this way:  IF ISTRUE bSchrikkel THEN

* A little bit strange to ask the user to press (Y/N) but only test for the
letter 'J' :-)

Sebastian Groeneveld


Quote:
> Dear All,

> Is my code corrected from the syntax for PBCC?

> Here's my code

> %TRUE   = -1
> %FALSE  = Not %TRUE

> Function PbMain()
>     Dim iJaar       As Word
>     Dim sAntw       As String
>     Dim bSchrikkel  As Integer

>     Do
>         iJaar = CInt(Invoer("Geef een jaartal in : "))

>         If (iJaar Mod 4 = 0) And (iJaar Mod 100 <> 0) Or (iJaar Mod
> 400 = 0) Then
>             bSchrikkel = IsTrue
>         Else
>             BSchrikkel = IsFalse
>         End If

>         If bSchrikkel = IsTrue Then
>             StdOut "Het jaar " & Str$(iJaar) & " is een schrikkeljaar"
>         Else
>             StdOut "Het jaar " & Str$(iJaar) & " is geen
> schrikkeljaar"
>         End If

>         sAntw = Invoer("Wilt u nogmaals? (Y/N) ")
>         WaitKey$

>     Loop While sAntw = "J"

> End Function

> Function Invoer(ByVal sVraag As String) As String
>     StdOut sVraag
>     Function = StdIn Line sVraag
> End Function



Tue, 14 Jun 2005 23:31:59 GMT  
 Problem with excuting
What problem you having ?

Strange:

This is the second time I saw:

If (iJaar Mod 4 = 0) And (iJaar Mod 100 <> 0) Or (iJaar Mod 400 = 0) Then

use for checking if a leap year. The first time I saw it was in a C++
(MSVC++) app.

Kind Regards,

Lennie De Villiers


Web: www.lando.co.za/Lennie
CV/Resume: www.lando.co.za/Lennie/CV.htm

"Deliver yesterday, code today, think tomorrow. "

- Programming Humor

Quote:
--- Original Message --

> Is my code corrected from the syntax for PBCC?

> Here's my code

> %TRUE   = -1
> %FALSE  = Not %TRUE

> Function PbMain()
>     Dim iJaar       As Word
>     Dim sAntw       As String
>     Dim bSchrikkel  As Integer

>     Do
>         iJaar = CInt(Invoer("Geef een jaartal in : "))

>         If (iJaar Mod 4 = 0) And (iJaar Mod 100 <> 0) Or (iJaar Mod
> 400 = 0) Then
>             bSchrikkel = IsTrue
>         Else
>             BSchrikkel = IsFalse
>         End If

>         If bSchrikkel = IsTrue Then
>             StdOut "Het jaar " & Str$(iJaar) & " is een schrikkeljaar"
>         Else
>             StdOut "Het jaar " & Str$(iJaar) & " is geen
> schrikkeljaar"
>         End If

>         sAntw = Invoer("Wilt u nogmaals? (Y/N) ")
>         WaitKey$

>     Loop While sAntw = "J"

> End Function

> Function Invoer(ByVal sVraag As String) As String
>     StdOut sVraag
>     Function = StdIn Line sVraag
> End Function



Thu, 16 Jun 2005 19:31:25 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. when i change a computer to excute my program,the problem appears again

2. excuting stored procedures

3. Viewing clock time while excuting a code

4. newbie:: error while excuting "exec wish"

5. behaviour of TCL excuting C programs on NT

6. Excuting scripts question

7. How can I specify a type descriptor when excuting the "Set...

8. how to excute a python-2.2 script in python-1.5.2?

9. Problems, problems, problems

10. Eiffel Problems, Problems, Problems

11. Finn Idiom problems and Re: {rho} problem

12. Combinatorial Problem [ & a new Combinatorial Problem ]

 

 
Powered by phpBB® Forum Software