main method

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

main method

Andre Gillieron


Hi all,
this is my first netrexx program, and it gives me an  error, of course -
not a good start :-)

Compile goes good, but when I run  "java MsgFileReader usenetfile.txt it
reports " I get :



in class MsgFileReader : void main(  string=argv[]  ) is not defined

Any hint ?

TIA



---------------- file MsgFileReader.nrx ---------------
Class MsgFileReader extends FileReader

Properties


Method MsgFileReader( filename = string )

        super( filename )


Method CheckType()

     path = rexx
     ok = boolean
     br = bufferedreader( this )
     line = br.readline
     say line
     parse line path .
     if path = 'Path:' then ok = 1
     return ok

Method Main( argv = string )

parse argv filename

ur = MsgFileReader( filename )
ur.checktype()



corrado agusto \\___ [hidden email]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note
to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: main method

Andre Gillieron


Ciao Corrado,

hai scritto:

> Hi all,
> this is my first netrexx program, and it gives me an  error, of course -
> not a good start :-)
>
> Compile goes good, but when I run  "java MsgFileReader usenetfile.txt it
> reports " I get :
>
> in class MsgFileReader : void main(  string=argv[]  ) is not defined
>
> Any hint ?

[..]

> Method Main( argv = string )

Yes -- the "main" method you coded is not the same "main" you wanted to
code. :-)

The "main" method that Java wants in order to run the class as a program is
main(string[]).

Try with

method main(CommandLine=String[]) public static

Max

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note
to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>