Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Translating C# to PowerBuilder Syntax

11 posts in .NET Winform Last posting was on 2008-12-31 02:39:29.0Z
Paul Murray Posted on 2008-12-30 03:17:09.0Z
From: "Paul Murray" <pemurray@staysystems.com>
Newsgroups: sybase.public.powerbuilder.net.winform
Subject: Translating C# to PowerBuilder Syntax
Lines: 84
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <495992b5$1@forums-1-dub>
Date: 29 Dec 2008 19:17:09 -0800
X-Trace: forums-1-dub 1230607029 10.22.241.152 (29 Dec 2008 19:17:09 -0800)
X-Original-Trace: 29 Dec 2008 19:17:09 -0800, vip152.sybase.com
X-Authenticated-User: pb110beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:746
Article PK: 707481

Dear friends,

I am trialing an email validation component from Dart. The example code to
call the component is available in either C# or VB and is displayed below.

1) I would like to get some help translating it to run in an '#IF PBWINFORM'
block of code.
2) I would really like some insight as to what is the process by which code
has to be changed over to PB syntax so that I can do it myself as there are
other functions that I want to implement. OR, is it possible to simply
insert C# code and PB will use as it ultimately generates C# code anyway for
the deployed code?

As to the two examples below, the C# code at least looks much more like PB
syntax than the VB code.

Thank you!!!

Paul

C#]

private string doValidation(string emailAddress)
{
//Add "using Dart.PowerTCP.EmailValidation;" at the top

//Validate to the final level
validator1.ValidationLevel = ValidationLevel.SmtpRecipient;

//DNS settings
validator1.Dns.RotateServers = false; //always start with first server
validator1.Dns.Retries = 2; //try up to 3 times
validator1.Dns.Timeout = 5000; //5 seconds

//SMTP settings
validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
validator1.Smtp.ConnectTimeout = 40000; //40 seconds
validator1.Smtp.ReceiveTimeout = 40000; //40 seconds

//Validate and return the result
ValidationState result = validator1.Validate(emailAddress);
string description = "The validation of " + result.EmailAddress + "
proceeded to the ";
description += result.Progress.ToString() + " level. ";
description += (result.Exception == null)
? "The validation was successful."
: "The following exception occurred: " + result.Exception.ToString();
return description;
}


[Visual Basic]

Private Function doValidation(ByVal emailAddress As String) As String
'Add "Imports Dart.PowerTCP.EmailValidation" at the top

'Validate to the final level
Validator1.ValidationLevel = ValidationLevel.SmtpRecipient

'DNS settings
Validator1.Dns.RotateServers = False 'always start with first server
Validator1.Dns.Retries = 2 'try up to 3 times
Validator1.Dns.Timeout = 5000 '5 seconds

'SMTP settings
Validator1.Smtp.MailFrom = "myAccount@myDomain.com" 'required
Validator1.Smtp.ConnectTimeout = 40000 '40 seconds
Validator1.Smtp.ReceiveTimeout = 40000 '40 seconds

'Validate and return the result
Dim result As ValidationState = Validator1.Validate(emailAddress)
Dim description As String = "The validation of " + result.EmailAddress +
" proceeded to the "
description += result.Progress.ToString() + " level. "
If (result.Exception Is Nothing) Then
description += "The validation was successful."
Else
description += "The following exception occurred: " +
result.Exception.ToString()
End If
Return description
End Function


"Paul Horan[Sybase]" <phoran_remove Posted on 2008-12-30 06:16:55.0Z
From: "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com>
Newsgroups: sybase.public.powerbuilder.net.winform
References: <495992b5$1@forums-1-dub>
Subject: Re: Translating C# to PowerBuilder Syntax
Lines: 99
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4959bcd7$1@forums-1-dub>
Date: 29 Dec 2008 22:16:55 -0800
X-Trace: forums-1-dub 1230617815 10.22.241.152 (29 Dec 2008 22:16:55 -0800)
X-Original-Trace: 29 Dec 2008 22:16:55 -0800, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:748
Article PK: 707479

What is the "validator1" class? How is that code instantiating and
assigning that variable?

If it's a .Net assembly, you just import the DLL into your target, and you
reference the class just as if it was any other PB object (more or less).

--
Paul Horan[Sybase]
paulhoran.pbdjmagazine.com

"Paul Murray" <pemurray@staysystems.com> wrote in message
news:495992b5$1@forums-1-dub...
> Dear friends,
>
> I am trialing an email validation component from Dart. The example code
> to call the component is available in either C# or VB and is displayed
> below.
>
> 1) I would like to get some help translating it to run in an '#IF
> PBWINFORM' block of code.
> 2) I would really like some insight as to what is the process by which
> code has to be changed over to PB syntax so that I can do it myself as
> there are other functions that I want to implement. OR, is it possible to
> simply insert C# code and PB will use as it ultimately generates C# code
> anyway for the deployed code?
>
> As to the two examples below, the C# code at least looks much more like PB
> syntax than the VB code.
>
> Thank you!!!
>
> Paul
>
> C#]
>
> private string doValidation(string emailAddress)
> {
> //Add "using Dart.PowerTCP.EmailValidation;" at the top
>
> //Validate to the final level
> validator1.ValidationLevel = ValidationLevel.SmtpRecipient;
>
> //DNS settings
> validator1.Dns.RotateServers = false; //always start with first server
> validator1.Dns.Retries = 2; //try up to 3 times
> validator1.Dns.Timeout = 5000; //5 seconds
>
> //SMTP settings
> validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>
> //Validate and return the result
> ValidationState result = validator1.Validate(emailAddress);
> string description = "The validation of " + result.EmailAddress + "
> proceeded to the ";
> description += result.Progress.ToString() + " level. ";
> description += (result.Exception == null)
> ? "The validation was successful."
> : "The following exception occurred: " +
> result.Exception.ToString();
> return description;
> }
>
>
> [Visual Basic]
>
> Private Function doValidation(ByVal emailAddress As String) As String
> 'Add "Imports Dart.PowerTCP.EmailValidation" at the top
>
> 'Validate to the final level
> Validator1.ValidationLevel = ValidationLevel.SmtpRecipient
>
> 'DNS settings
> Validator1.Dns.RotateServers = False 'always start with first server
> Validator1.Dns.Retries = 2 'try up to 3 times
> Validator1.Dns.Timeout = 5000 '5 seconds
>
> 'SMTP settings
> Validator1.Smtp.MailFrom = "myAccount@myDomain.com" 'required
> Validator1.Smtp.ConnectTimeout = 40000 '40 seconds
> Validator1.Smtp.ReceiveTimeout = 40000 '40 seconds
>
> 'Validate and return the result
> Dim result As ValidationState = Validator1.Validate(emailAddress)
> Dim description As String = "The validation of " + result.EmailAddress
> + " proceeded to the "
> description += result.Progress.ToString() + " level. "
> If (result.Exception Is Nothing) Then
> description += "The validation was successful."
> Else
> description += "The following exception occurred: " +
> result.Exception.ToString()
> End If
> Return description
> End Function
>


Paul Murray Posted on 2008-12-30 16:17:27.0Z
From: "Paul Murray" <pemurray@staysystems.com>
Newsgroups: sybase.public.powerbuilder.net.winform
References: <495992b5$1@forums-1-dub> <4959bcd7$1@forums-1-dub>
Subject: Re: Translating C# to PowerBuilder Syntax
Lines: 122
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <495a4997$1@forums-1-dub>
Date: 30 Dec 2008 08:17:27 -0800
X-Trace: forums-1-dub 1230653847 10.22.241.152 (30 Dec 2008 08:17:27 -0800)
X-Original-Trace: 30 Dec 2008 08:17:27 -0800, vip152.sybase.com
X-Authenticated-User: pb110beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:750
Article PK: 707485

Thanks Paul and Bruce,

The 'validator1' class is part of a .NET assembly that I did import into my
target (in the same way that I import system.dll) in order to send smtp
emails via .NET.

The name of the .dll is Dart.PowerTCP.EmailValidation.Trial.dll.

It appears that Jaque had the same problem on 11/12 where he was getting the
Writeproperty error as well. His issue has no resolution.

So I am looking for some help, please, with changing Dart's C# sample code
to PB so that it work.

Thanks, All!!!

Paul

"Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
news:4959bcd7$1@forums-1-dub...
> What is the "validator1" class? How is that code instantiating and
> assigning that variable?
>
> If it's a .Net assembly, you just import the DLL into your target, and you
> reference the class just as if it was any other PB object (more or less).
>
> --
> Paul Horan[Sybase]
> paulhoran.pbdjmagazine.com
>
> "Paul Murray" <pemurray@staysystems.com> wrote in message
> news:495992b5$1@forums-1-dub...
>> Dear friends,
>>
>> I am trialing an email validation component from Dart. The example code
>> to call the component is available in either C# or VB and is displayed
>> below.
>>
>> 1) I would like to get some help translating it to run in an '#IF
>> PBWINFORM' block of code.
>> 2) I would really like some insight as to what is the process by which
>> code has to be changed over to PB syntax so that I can do it myself as
>> there are other functions that I want to implement. OR, is it possible
>> to simply insert C# code and PB will use as it ultimately generates C#
>> code anyway for the deployed code?
>>
>> As to the two examples below, the C# code at least looks much more like
>> PB syntax than the VB code.
>>
>> Thank you!!!
>>
>> Paul
>>
>> C#]
>>
>> private string doValidation(string emailAddress)
>> {
>> //Add "using Dart.PowerTCP.EmailValidation;" at the top
>>
>> //Validate to the final level
>> validator1.ValidationLevel = ValidationLevel.SmtpRecipient;
>>
>> //DNS settings
>> validator1.Dns.RotateServers = false; //always start with first server
>> validator1.Dns.Retries = 2; //try up to 3 times
>> validator1.Dns.Timeout = 5000; //5 seconds
>>
>> //SMTP settings
>> validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>
>> //Validate and return the result
>> ValidationState result = validator1.Validate(emailAddress);
>> string description = "The validation of " + result.EmailAddress + "
>> proceeded to the ";
>> description += result.Progress.ToString() + " level. ";
>> description += (result.Exception == null)
>> ? "The validation was successful."
>> : "The following exception occurred: " +
>> result.Exception.ToString();
>> return description;
>> }
>>
>>
>> [Visual Basic]
>>
>> Private Function doValidation(ByVal emailAddress As String) As String
>> 'Add "Imports Dart.PowerTCP.EmailValidation" at the top
>>
>> 'Validate to the final level
>> Validator1.ValidationLevel = ValidationLevel.SmtpRecipient
>>
>> 'DNS settings
>> Validator1.Dns.RotateServers = False 'always start with first server
>> Validator1.Dns.Retries = 2 'try up to 3 times
>> Validator1.Dns.Timeout = 5000 '5 seconds
>>
>> 'SMTP settings
>> Validator1.Smtp.MailFrom = "myAccount@myDomain.com" 'required
>> Validator1.Smtp.ConnectTimeout = 40000 '40 seconds
>> Validator1.Smtp.ReceiveTimeout = 40000 '40 seconds
>>
>> 'Validate and return the result
>> Dim result As ValidationState = Validator1.Validate(emailAddress)
>> Dim description As String = "The validation of " + result.EmailAddress
>> + " proceeded to the "
>> description += result.Progress.ToString() + " level. "
>> If (result.Exception Is Nothing) Then
>> description += "The validation was successful."
>> Else
>> description += "The following exception occurred: " +
>> result.Exception.ToString()
>> End If
>> Return description
>> End Function
>>
>
>


Bruce Armstrong [TeamSybase] Posted on 2008-12-30 13:51:32.0Z
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Newsgroups: sybase.public.powerbuilder.net.winform
Subject: Re: Translating C# to PowerBuilder Syntax
Organization: TeamSybase
Reply-To: NOCANSPAM_bruce.armstrong@teamsybase.com
Message-ID: <fq9kl417f08jj15fndgjnncjv1bs17ecdn@4ax.com>
References: <495992b5$1@forums-1-dub>
X-Newsreader: Forte Agent 5.00/32.1170 trialware
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 30 Dec 2008 05:51:32 -0800
X-Trace: forums-1-dub 1230645092 10.22.241.152 (30 Dec 2008 05:51:32 -0800)
X-Original-Trace: 30 Dec 2008 05:51:32 -0800, vip152.sybase.com
Lines: 100
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:749
Article PK: 707483

You could just create your own .Net assembly in C# and then call that
from PB.

On 29 Dec 2008 19:17:09 -0800, "Paul Murray"

<pemurray@staysystems.com> wrote:

>Dear friends,
>
>I am trialing an email validation component from Dart. The example code to
>call the component is available in either C# or VB and is displayed below.
>
>1) I would like to get some help translating it to run in an '#IF PBWINFORM'
>block of code.
>2) I would really like some insight as to what is the process by which code
>has to be changed over to PB syntax so that I can do it myself as there are
>other functions that I want to implement. OR, is it possible to simply
>insert C# code and PB will use as it ultimately generates C# code anyway for
>the deployed code?
>
>As to the two examples below, the C# code at least looks much more like PB
>syntax than the VB code.
>
>Thank you!!!
>
>Paul
>
>C#]
>
>private string doValidation(string emailAddress)
>{
> //Add "using Dart.PowerTCP.EmailValidation;" at the top
>
> //Validate to the final level
> validator1.ValidationLevel = ValidationLevel.SmtpRecipient;
>
> //DNS settings
> validator1.Dns.RotateServers = false; //always start with first server
> validator1.Dns.Retries = 2; //try up to 3 times
> validator1.Dns.Timeout = 5000; //5 seconds
>
> //SMTP settings
> validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>
> //Validate and return the result
> ValidationState result = validator1.Validate(emailAddress);
> string description = "The validation of " + result.EmailAddress + "
>proceeded to the ";
> description += result.Progress.ToString() + " level. ";
> description += (result.Exception == null)
> ? "The validation was successful."
> : "The following exception occurred: " + result.Exception.ToString();
> return description;
>}
>
>
>[Visual Basic]
>
>Private Function doValidation(ByVal emailAddress As String) As String
> 'Add "Imports Dart.PowerTCP.EmailValidation" at the top
>
> 'Validate to the final level
> Validator1.ValidationLevel = ValidationLevel.SmtpRecipient
>
> 'DNS settings
> Validator1.Dns.RotateServers = False 'always start with first server
> Validator1.Dns.Retries = 2 'try up to 3 times
> Validator1.Dns.Timeout = 5000 '5 seconds
>
> 'SMTP settings
> Validator1.Smtp.MailFrom = "myAccount@myDomain.com" 'required
> Validator1.Smtp.ConnectTimeout = 40000 '40 seconds
> Validator1.Smtp.ReceiveTimeout = 40000 '40 seconds
>
> 'Validate and return the result
> Dim result As ValidationState = Validator1.Validate(emailAddress)
> Dim description As String = "The validation of " + result.EmailAddress +
>" proceeded to the "
> description += result.Progress.ToString() + " level. "
> If (result.Exception Is Nothing) Then
> description += "The validation was successful."
> Else
> description += "The following exception occurred: " +
>result.Exception.ToString()
> End If
> Return description
>End Function
>

-----------------------------------

My Web 2.0 Stuff

Blog: http://bruce.pbdjmagazine.com/
Facebook: http://www.facebook.com/people/Bruce-Armstrong/1600223798
Fotki: http://public.fotki.com/brucearmstrong/
LinkedIn: http://www.linkedin.com/in/bruceaarmstrong
Twitter: http://twitter.com/bruce_armstrong
YouTube: http://www.youtube.com/user/brucearmstrong


Paul Murray Posted on 2008-12-30 06:16:41.0Z
From: "Paul Murray" <pemurray@staysystems.com>
Newsgroups: sybase.public.powerbuilder.net.winform
References: <495992b5$1@forums-1-dub>
Subject: Re: Translating C# to PowerBuilder Syntax - Made a little progress...
Lines: 227
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4959bcc9@forums-1-dub>
Date: 29 Dec 2008 22:16:41 -0800
X-Trace: forums-1-dub 1230617801 10.22.241.152 (29 Dec 2008 22:16:41 -0800)
X-Original-Trace: 29 Dec 2008 22:16:41 -0800, vip152.sybase.com
X-Authenticated-User: pb110beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:747
Article PK: 707484

Hi All,

I made a little progress by figuring out that one of the properties was
enumerated and I had to add an '!' to the end of it. Now I am getting an
error as follows when I try to set a property. I have a lot of these
errors.:

"A privatewrite property can be modified only in an event or function in its
parent class."

So I was thinking, should I be creating this a function of custom class or
something like that?

Thanks All!!

Paul

/////////////////////////////////START DART EMAIL VALIDATION
TEST///////////////////////////////////
//long rows
rows = dw_1.rowcount()

messagebox("START","Number of rows is: " + string(rows))

string i_email
string validationstate
string validationresult
//string i_validationlevel
//i_validationlevel = "SmtpRecipient"
long i

for i = 1 to rows
yield()
if interrupt_email_sort = true then
interrupt_email_sort = false
result2 = messagebox("Pause...","Do you want to stop this
process?",Exclamation!, OKCancel!, 2)
if result2 = 1 then
cb_6.hide()
exit
end if
else

i_email = dw_1.getitemstring(i,"email_address")

#if defined PBWINFORM then

//[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false,
Inherited = false)] public sealed class LicenseProviderAttribute : Attribute

Dart.PowerTCP.EmailValidation.Validator validator1
validator1 = Create Dart.PowerTCP.EmailValidation.Validator

//Validate to the final level
//Damn, you have to add the '!' to the end of an enumeration (whatever
that is). I guess it is a CHOICE.
validator1.ValidationLevel =
Dart.PowerTCP.EmailValidation.ValidationLevel.SmtpRecipient!

//DNS settings
validator1.Dns.RotateServers = FALSE //always start with first server
THIS IS LINE 46 PER THE ERRORS BELOW.
validator1.Dns.Retries = 2; //try up to 3 times
validator1.Dns.Timeout = 5000; //5 seconds

//SMTP settings
//validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
validator1.Smtp.MailFrom = "pemurray@staysystems.com"; //required
validator1.Smtp.ConnectTimeout = 40000; //40 seconds
validator1.Smtp.ReceiveTimeout = 40000; //40 seconds

//Validate and return the result
//ValidationState result = validator1.Validate(emailAddress);
ValidationState result = validator1.Validate(i_email);
string email_result, progress, exception_level
email_result = result.EmailAddress
progress = result.Progress.ToString()
exception_level = result.Exception
// ? "The validation was successful."
// : "The following exception occurred: " +
result.Exception.ToString();

//Return description
messagebox("INSIDE LOOP INSIDE pbwinform","Row " + string(i) + " of " +
string(rows))
messagebox("email_result",email_result)
messagebox("progress",progress)
messagebox("exception_level",exception_level)

#end if
end if

next

/////////////////////////////////END DART EMAIL VALIDATION
TEST///////////////////////////////////

---------- Error messages: (00:53:29 )
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.46
C0143: A privatewrite property can be modified only in an event or function
in its parent class.
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.47
C0143: A privatewrite property can be modified only in an event or function
in its parent class.
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.48
C0143: A privatewrite property can be modified only in an event or function
in its parent class.
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.52
C0143: A privatewrite property can be modified only in an event or function
in its parent class.
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.53
C0143: A privatewrite property can be modified only in an event or function
in its parent class.
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.54
C0143: A privatewrite property can be modified only in an event or function
in its parent class.
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.58
C0001: Illegal data type: validationstate.
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.60
C0018: Cannot use dot operator on expression of undetermined type.
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.61
C0018: Cannot use dot operator on expression of undetermined type.
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.62
C0018: Cannot use dot operator on expression of undetermined type.
---------- Finished (00:53:29 )


************

"Paul Murray" <pemurray@staysystems.com> wrote in message
news:495992b5$1@forums-1-dub...
> Dear friends,
>
> I am trialing an email validation component from Dart. The example code
> to call the component is available in either C# or VB and is displayed
> below.
>
> 1) I would like to get some help translating it to run in an '#IF
> PBWINFORM' block of code.
> 2) I would really like some insight as to what is the process by which
> code has to be changed over to PB syntax so that I can do it myself as
> there are other functions that I want to implement. OR, is it possible to
> simply insert C# code and PB will use as it ultimately generates C# code
> anyway for the deployed code?
>
> As to the two examples below, the C# code at least looks much more like PB
> syntax than the VB code.
>
> Thank you!!!
>
> Paul
>
> C#]
>
> private string doValidation(string emailAddress)
> {
> //Add "using Dart.PowerTCP.EmailValidation;" at the top
>
> //Validate to the final level
> validator1.ValidationLevel = ValidationLevel.SmtpRecipient;
>
> //DNS settings
> validator1.Dns.RotateServers = false; //always start with first server
> validator1.Dns.Retries = 2; //try up to 3 times
> validator1.Dns.Timeout = 5000; //5 seconds
>
> //SMTP settings
> validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>
> //Validate and return the result
> ValidationState result = validator1.Validate(emailAddress);
> string description = "The validation of " + result.EmailAddress + "
> proceeded to the ";
> description += result.Progress.ToString() + " level. ";
> description += (result.Exception == null)
> ? "The validation was successful."
> : "The following exception occurred: " +
> result.Exception.ToString();
> return description;
> }
>
>
> [Visual Basic]
>
> Private Function doValidation(ByVal emailAddress As String) As String
> 'Add "Imports Dart.PowerTCP.EmailValidation" at the top
>
> 'Validate to the final level
> Validator1.ValidationLevel = ValidationLevel.SmtpRecipient
>
> 'DNS settings
> Validator1.Dns.RotateServers = False 'always start with first server
> Validator1.Dns.Retries = 2 'try up to 3 times
> Validator1.Dns.Timeout = 5000 '5 seconds
>
> 'SMTP settings
> Validator1.Smtp.MailFrom = "myAccount@myDomain.com" 'required
> Validator1.Smtp.ConnectTimeout = 40000 '40 seconds
> Validator1.Smtp.ReceiveTimeout = 40000 '40 seconds
>
> 'Validate and return the result
> Dim result As ValidationState = Validator1.Validate(emailAddress)
> Dim description As String = "The validation of " + result.EmailAddress
> + " proceeded to the "
> description += result.Progress.ToString() + " level. "
> If (result.Exception Is Nothing) Then
> description += "The validation was successful."
> Else
> description += "The following exception occurred: " +
> result.Exception.ToString()
> End If
> Return description
> End Function
>


"Paul Horan[Sybase]" <phoran_remove Posted on 2008-12-30 17:31:19.0Z
From: "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com>
Newsgroups: sybase.public.powerbuilder.net.winform
References: <495992b5$1@forums-1-dub> <4959bcc9@forums-1-dub>
Subject: Re: Translating C# to PowerBuilder Syntax - Made a little progress...
Lines: 243
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <495a5ae7@forums-1-dub>
Date: 30 Dec 2008 09:31:19 -0800
X-Trace: forums-1-dub 1230658279 10.22.241.152 (30 Dec 2008 09:31:19 -0800)
X-Original-Trace: 30 Dec 2008 09:31:19 -0800, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:751
Article PK: 707482

What version of PB are you using?
Which line of code causes this error?

I downloaded and installed that .Net assembly, and all the properties and
methods show as PUBLIC, so I'm not sure why you're seeing them as
PrivateWrite...

--
Paul Horan[Sybase]
paulhoran.pbdjmagazine.com

"Paul Murray" <pemurray@staysystems.com> wrote in message
news:4959bcc9@forums-1-dub...
> Hi All,
>
> I made a little progress by figuring out that one of the properties was
> enumerated and I had to add an '!' to the end of it. Now I am getting an
> error as follows when I try to set a property. I have a lot of these
> errors.:
>
> "A privatewrite property can be modified only in an event or function in
> its parent class."
>
> So I was thinking, should I be creating this a function of custom class or
> something like that?
>
> Thanks All!!
>
> Paul
>
> /////////////////////////////////START DART EMAIL VALIDATION
> TEST///////////////////////////////////
> //long rows
> rows = dw_1.rowcount()
>
> messagebox("START","Number of rows is: " + string(rows))
>
> string i_email
> string validationstate
> string validationresult
> //string i_validationlevel
> //i_validationlevel = "SmtpRecipient"
> long i
>
> for i = 1 to rows
> yield()
> if interrupt_email_sort = true then
> interrupt_email_sort = false
> result2 = messagebox("Pause...","Do you want to stop this
> process?",Exclamation!, OKCancel!, 2)
> if result2 = 1 then
> cb_6.hide()
> exit
> end if
> else
>
> i_email = dw_1.getitemstring(i,"email_address")
>
> #if defined PBWINFORM then
>
> //[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple =
> false, Inherited = false)] public sealed class LicenseProviderAttribute :
> Attribute
>
> Dart.PowerTCP.EmailValidation.Validator validator1
> validator1 = Create Dart.PowerTCP.EmailValidation.Validator
>
> //Validate to the final level
> //Damn, you have to add the '!' to the end of an enumeration (whatever
> that is). I guess it is a CHOICE.
> validator1.ValidationLevel =
> Dart.PowerTCP.EmailValidation.ValidationLevel.SmtpRecipient!
>
> //DNS settings
> validator1.Dns.RotateServers = FALSE //always start with first server
> THIS IS LINE 46 PER THE ERRORS BELOW.
> validator1.Dns.Retries = 2; //try up to 3 times
> validator1.Dns.Timeout = 5000; //5 seconds
>
> //SMTP settings
> //validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
> validator1.Smtp.MailFrom = "pemurray@staysystems.com"; //required
> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>
> //Validate and return the result
> //ValidationState result = validator1.Validate(emailAddress);
> ValidationState result = validator1.Validate(i_email);
> string email_result, progress, exception_level
> email_result = result.EmailAddress
> progress = result.Progress.ToString()
> exception_level = result.Exception
> // ? "The validation was successful."
> // : "The following exception occurred: " +
> result.Exception.ToString();
>
> //Return description
> messagebox("INSIDE LOOP INSIDE pbwinform","Row " + string(i) + " of " +
> string(rows))
> messagebox("email_result",email_result)
> messagebox("progress",progress)
> messagebox("exception_level",exception_level)
>
> #end if
> end if
>
> next
>
> /////////////////////////////////END DART EMAIL VALIDATION
> TEST///////////////////////////////////
>
> ---------- Error messages: (00:53:29 )
> c:\documents and settings\administrator\my
> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.46
> C0143: A privatewrite property can be modified only in an event or
> function in its parent class.
> c:\documents and settings\administrator\my
> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.47
> C0143: A privatewrite property can be modified only in an event or
> function in its parent class.
> c:\documents and settings\administrator\my
> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.48
> C0143: A privatewrite property can be modified only in an event or
> function in its parent class.
> c:\documents and settings\administrator\my
> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.52
> C0143: A privatewrite property can be modified only in an event or
> function in its parent class.
> c:\documents and settings\administrator\my
> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.53
> C0143: A privatewrite property can be modified only in an event or
> function in its parent class.
> c:\documents and settings\administrator\my
> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.54
> C0143: A privatewrite property can be modified only in an event or
> function in its parent class.
> c:\documents and settings\administrator\my
> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.58
> C0001: Illegal data type: validationstate.
> c:\documents and settings\administrator\my
> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.60
> C0018: Cannot use dot operator on expression of undetermined type.
> c:\documents and settings\administrator\my
> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.61
> C0018: Cannot use dot operator on expression of undetermined type.
> c:\documents and settings\administrator\my
> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.62
> C0018: Cannot use dot operator on expression of undetermined type.
> ---------- Finished (00:53:29 )
>
>
> ************
> "Paul Murray" <pemurray@staysystems.com> wrote in message
> news:495992b5$1@forums-1-dub...
>> Dear friends,
>>
>> I am trialing an email validation component from Dart. The example code
>> to call the component is available in either C# or VB and is displayed
>> below.
>>
>> 1) I would like to get some help translating it to run in an '#IF
>> PBWINFORM' block of code.
>> 2) I would really like some insight as to what is the process by which
>> code has to be changed over to PB syntax so that I can do it myself as
>> there are other functions that I want to implement. OR, is it possible
>> to simply insert C# code and PB will use as it ultimately generates C#
>> code anyway for the deployed code?
>>
>> As to the two examples below, the C# code at least looks much more like
>> PB syntax than the VB code.
>>
>> Thank you!!!
>>
>> Paul
>>
>> C#]
>>
>> private string doValidation(string emailAddress)
>> {
>> //Add "using Dart.PowerTCP.EmailValidation;" at the top
>>
>> //Validate to the final level
>> validator1.ValidationLevel = ValidationLevel.SmtpRecipient;
>>
>> //DNS settings
>> validator1.Dns.RotateServers = false; //always start with first server
>> validator1.Dns.Retries = 2; //try up to 3 times
>> validator1.Dns.Timeout = 5000; //5 seconds
>>
>> //SMTP settings
>> validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>
>> //Validate and return the result
>> ValidationState result = validator1.Validate(emailAddress);
>> string description = "The validation of " + result.EmailAddress + "
>> proceeded to the ";
>> description += result.Progress.ToString() + " level. ";
>> description += (result.Exception == null)
>> ? "The validation was successful."
>> : "The following exception occurred: " +
>> result.Exception.ToString();
>> return description;
>> }
>>
>>
>> [Visual Basic]
>>
>> Private Function doValidation(ByVal emailAddress As String) As String
>> 'Add "Imports Dart.PowerTCP.EmailValidation" at the top
>>
>> 'Validate to the final level
>> Validator1.ValidationLevel = ValidationLevel.SmtpRecipient
>>
>> 'DNS settings
>> Validator1.Dns.RotateServers = False 'always start with first server
>> Validator1.Dns.Retries = 2 'try up to 3 times
>> Validator1.Dns.Timeout = 5000 '5 seconds
>>
>> 'SMTP settings
>> Validator1.Smtp.MailFrom = "myAccount@myDomain.com" 'required
>> Validator1.Smtp.ConnectTimeout = 40000 '40 seconds
>> Validator1.Smtp.ReceiveTimeout = 40000 '40 seconds
>>
>> 'Validate and return the result
>> Dim result As ValidationState = Validator1.Validate(emailAddress)
>> Dim description As String = "The validation of " + result.EmailAddress
>> + " proceeded to the "
>> description += result.Progress.ToString() + " level. "
>> If (result.Exception Is Nothing) Then
>> description += "The validation was successful."
>> Else
>> description += "The following exception occurred: " +
>> result.Exception.ToString()
>> End If
>> Return description
>> End Function
>>
>
>


Paul Murray Posted on 2008-12-30 17:46:15.0Z
From: "Paul Murray" <pemurray@staysystems.com>
Newsgroups: sybase.public.powerbuilder.net.winform
References: <495992b5$1@forums-1-dub> <4959bcc9@forums-1-dub> <495a5ae7@forums-1-dub>
Subject: Re: Translating C# to PowerBuilder Syntax - Made a little progress...
Lines: 7234
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <495a5e67@forums-1-dub>
Date: 30 Dec 2008 09:46:15 -0800
X-Trace: forums-1-dub 1230659175 10.22.241.152 (30 Dec 2008 09:46:15 -0800)
X-Original-Trace: 30 Dec 2008 09:46:15 -0800, vip152.sybase.com
X-Authenticated-User: pb110beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:752
Article PK: 707499

Hi Paul,

Thanks for your help!! And thanks for going the extra mile and installing
the .NET assembly in question.

I am using PB 11.2 Build 8616.

While I am getting lots of errors, it appears that the first instance of the
error is here (see attached screen shot):

validator1.Dns.RotateServers = FALSE //always start with first server

The associated error is:

c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl
(w_manage_scrub_list).cb_10.clicked.46 C0143: A privatewrite property can be
modified only in an event or function in its parent class.

Thanks again!

Paul

"Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
news:495a5ae7@forums-1-dub...
> What version of PB are you using?
> Which line of code causes this error?
>
> I downloaded and installed that .Net assembly, and all the properties and
> methods show as PUBLIC, so I'm not sure why you're seeing them as
> PrivateWrite...
>
> --
> Paul Horan[Sybase]
> paulhoran.pbdjmagazine.com
>
> "Paul Murray" <pemurray@staysystems.com> wrote in message
> news:4959bcc9@forums-1-dub...
>> Hi All,
>>
>> I made a little progress by figuring out that one of the properties was
>> enumerated and I had to add an '!' to the end of it. Now I am getting an
>> error as follows when I try to set a property. I have a lot of these
>> errors.:
>>
>> "A privatewrite property can be modified only in an event or function in
>> its parent class."
>>
>> So I was thinking, should I be creating this a function of custom class
>> or
>> something like that?
>>
>> Thanks All!!
>>
>> Paul
>>
>> /////////////////////////////////START DART EMAIL VALIDATION
>> TEST///////////////////////////////////
>> //long rows
>> rows = dw_1.rowcount()
>>
>> messagebox("START","Number of rows is: " + string(rows))
>>
>> string i_email
>> string validationstate
>> string validationresult
>> //string i_validationlevel
>> //i_validationlevel = "SmtpRecipient"
>> long i
>>
>> for i = 1 to rows
>> yield()
>> if interrupt_email_sort = true then
>> interrupt_email_sort = false
>> result2 = messagebox("Pause...","Do you want to stop this
>> process?",Exclamation!, OKCancel!, 2)
>> if result2 = 1 then
>> cb_6.hide()
>> exit
>> end if
>> else
>>
>> i_email = dw_1.getitemstring(i,"email_address")
>>
>> #if defined PBWINFORM then
>>
>> //[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple =
>> false, Inherited = false)] public sealed class LicenseProviderAttribute :
>> Attribute
>>
>> Dart.PowerTCP.EmailValidation.Validator validator1
>> validator1 = Create Dart.PowerTCP.EmailValidation.Validator
>>
>> //Validate to the final level
>> //Damn, you have to add the '!' to the end of an enumeration (whatever
>> that is). I guess it is a CHOICE.
>> validator1.ValidationLevel =
>> Dart.PowerTCP.EmailValidation.ValidationLevel.SmtpRecipient!
>>
>> //DNS settings
>> validator1.Dns.RotateServers = FALSE //always start with first server
>> THIS IS LINE 46 PER THE ERRORS BELOW.
>> validator1.Dns.Retries = 2; //try up to 3 times
>> validator1.Dns.Timeout = 5000; //5 seconds
>>
>> //SMTP settings
>> //validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>> validator1.Smtp.MailFrom = "pemurray@staysystems.com"; //required
>> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>
>> //Validate and return the result
>> //ValidationState result = validator1.Validate(emailAddress);
>> ValidationState result = validator1.Validate(i_email);
>> string email_result, progress, exception_level
>> email_result = result.EmailAddress
>> progress = result.Progress.ToString()
>> exception_level = result.Exception
>> // ? "The validation was successful."
>> // : "The following exception occurred: " +
>> result.Exception.ToString();
>>
>> //Return description
>> messagebox("INSIDE LOOP INSIDE pbwinform","Row " + string(i) + " of " +
>> string(rows))
>> messagebox("email_result",email_result)
>> messagebox("progress",progress)
>> messagebox("exception_level",exception_level)
>>
>> #end if
>> end if
>>
>> next
>>
>> /////////////////////////////////END DART EMAIL VALIDATION
>> TEST///////////////////////////////////
>>
>> ---------- Error messages: (00:53:29 )
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.46
>> C0143: A privatewrite property can be modified only in an event or
>> function in its parent class.
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.47
>> C0143: A privatewrite property can be modified only in an event or
>> function in its parent class.
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.48
>> C0143: A privatewrite property can be modified only in an event or
>> function in its parent class.
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.52
>> C0143: A privatewrite property can be modified only in an event or
>> function in its parent class.
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.53
>> C0143: A privatewrite property can be modified only in an event or
>> function in its parent class.
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.54
>> C0143: A privatewrite property can be modified only in an event or
>> function in its parent class.
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.58
>> C0001: Illegal data type: validationstate.
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.60
>> C0018: Cannot use dot operator on expression of undetermined type.
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.61
>> C0018: Cannot use dot operator on expression of undetermined type.
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.62
>> C0018: Cannot use dot operator on expression of undetermined type.
>> ---------- Finished (00:53:29 )
>>
>>
>> ************
>> "Paul Murray" <pemurray@staysystems.com> wrote in message
>> news:495992b5$1@forums-1-dub...
>>> Dear friends,
>>>
>>> I am trialing an email validation component from Dart. The example code
>>> to call the component is available in either C# or VB and is displayed
>>> below.
>>>
>>> 1) I would like to get some help translating it to run in an '#IF
>>> PBWINFORM' block of code.
>>> 2) I would really like some insight as to what is the process by which
>>> code has to be changed over to PB syntax so that I can do it myself as
>>> there are other functions that I want to implement. OR, is it possible
>>> to simply insert C# code and PB will use as it ultimately generates C#
>>> code anyway for the deployed code?
>>>
>>> As to the two examples below, the C# code at least looks much more like
>>> PB syntax than the VB code.
>>>
>>> Thank you!!!
>>>
>>> Paul
>>>
>>> C#]
>>>
>>> private string doValidation(string emailAddress)
>>> {
>>> //Add "using Dart.PowerTCP.EmailValidation;" at the top
>>>
>>> //Validate to the final level
>>> validator1.ValidationLevel = ValidationLevel.SmtpRecipient;
>>>
>>> //DNS settings
>>> validator1.Dns.RotateServers = false; //always start with first server
>>> validator1.Dns.Retries = 2; //try up to 3 times
>>> validator1.Dns.Timeout = 5000; //5 seconds
>>>
>>> //SMTP settings
>>> validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>>> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>>> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>>
>>> //Validate and return the result
>>> ValidationState result = validator1.Validate(emailAddress);
>>> string description = "The validation of " + result.EmailAddress + "
>>> proceeded to the ";
>>> description += result.Progress.ToString() + " level. ";
>>> description += (result.Exception == null)
>>> ? "The validation was successful."
>>> : "The following exception occurred: " +
>>> result.Exception.ToString();
>>> return description;
>>> }
>>>
>>>
>>> [Visual Basic]
>>>
>>> Private Function doValidation(ByVal emailAddress As String) As String
>>> 'Add "Imports Dart.PowerTCP.EmailValidation" at the top
>>>
>>> 'Validate to the final level
>>> Validator1.ValidationLevel = ValidationLevel.SmtpRecipient
>>>
>>> 'DNS settings
>>> Validator1.Dns.RotateServers = False 'always start with first server
>>> Validator1.Dns.Retries = 2 'try up to 3 times
>>> Validator1.Dns.Timeout = 5000 '5 seconds
>>>
>>> 'SMTP settings
>>> Validator1.Smtp.MailFrom = "myAccount@myDomain.com" 'required
>>> Validator1.Smtp.ConnectTimeout = 40000 '40 seconds
>>> Validator1.Smtp.ReceiveTimeout = 40000 '40 seconds
>>>
>>> 'Validate and return the result
>>> Dim result As ValidationState = Validator1.Validate(emailAddress)
>>> Dim description As String = "The validation of " +
>>> result.EmailAddress
>>> + " proceeded to the "
>>> description += result.Progress.ToString() + " level. "
>>> If (result.Exception Is Nothing) Then
>>> description += "The validation was successful."
>>> Else
>>> description += "The following exception occurred: " +
>>> result.Exception.ToString()
>>> End If
>>> Return description
>>> End Function
>>>
>>
>>
>
>

DART  DOT NET ERROR.jpg

"Paul Horan[Sybase]" <phoran_remove Posted on 2008-12-30 18:21:32.0Z
From: "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com>
Newsgroups: sybase.public.powerbuilder.net.winform
References: <495992b5$1@forums-1-dub> <4959bcc9@forums-1-dub> <495a5ae7@forums-1-dub> <495a5e67@forums-1-dub>
Subject: Re: Translating C# to PowerBuilder Syntax - Made a little progress...
Lines: 305
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <495a66ac@forums-1-dub>
Date: 30 Dec 2008 10:21:32 -0800
X-Trace: forums-1-dub 1230661292 10.22.241.152 (30 Dec 2008 10:21:32 -0800)
X-Original-Trace: 30 Dec 2008 10:21:32 -0800, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:753
Article PK: 707488

I stand corrected!

The DNS property is defined as Public ReadOnly (which PB evaluates as
PrivateWrite).
The RotateServers property of the DNS structure is Public.

So I don't think you can update validator1.DNS.properties directly. You may
have to do it in two stages.
Try this.
Dart.PowerTCP.EmailValidation.Validator validator1
validator1 = Create Dart.PowerTCP.EmailValidation.Validator

Dart.PowerTCP.EmailValidation.Validator.DNS DNS1
DNS1 = validator1.DNS

DNS1.RotateServers = FALSE

That might help...

--
Paul Horan[Sybase]
paulhoran.pbdjmagazine.com

"Paul Murray" <pemurray@staysystems.com> wrote in message
news:495a5e67@forums-1-dub...
> Hi Paul,
>
> Thanks for your help!! And thanks for going the extra mile and installing
> the .NET assembly in question.
>
> I am using PB 11.2 Build 8616.
>
> While I am getting lots of errors, it appears that the first instance of
> the error is here (see attached screen shot):
>
> validator1.Dns.RotateServers = FALSE //always start with first server
>
> The associated error is:
>
> c:\documents and settings\administrator\my
> documents\!interrasys\!dev\emailmanager\emailmanager.pbl
> (w_manage_scrub_list).cb_10.clicked.46 C0143: A privatewrite property can
> be modified only in an event or function in its parent class.
>
> Thanks again!
>
> Paul
>
> "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
> news:495a5ae7@forums-1-dub...
>> What version of PB are you using?
>> Which line of code causes this error?
>>
>> I downloaded and installed that .Net assembly, and all the properties and
>> methods show as PUBLIC, so I'm not sure why you're seeing them as
>> PrivateWrite...
>>
>> --
>> Paul Horan[Sybase]
>> paulhoran.pbdjmagazine.com
>>
>> "Paul Murray" <pemurray@staysystems.com> wrote in message
>> news:4959bcc9@forums-1-dub...
>>> Hi All,
>>>
>>> I made a little progress by figuring out that one of the properties was
>>> enumerated and I had to add an '!' to the end of it. Now I am getting
>>> an
>>> error as follows when I try to set a property. I have a lot of these
>>> errors.:
>>>
>>> "A privatewrite property can be modified only in an event or function in
>>> its parent class."
>>>
>>> So I was thinking, should I be creating this a function of custom class
>>> or
>>> something like that?
>>>
>>> Thanks All!!
>>>
>>> Paul
>>>
>>> /////////////////////////////////START DART EMAIL VALIDATION
>>> TEST///////////////////////////////////
>>> //long rows
>>> rows = dw_1.rowcount()
>>>
>>> messagebox("START","Number of rows is: " + string(rows))
>>>
>>> string i_email
>>> string validationstate
>>> string validationresult
>>> //string i_validationlevel
>>> //i_validationlevel = "SmtpRecipient"
>>> long i
>>>
>>> for i = 1 to rows
>>> yield()
>>> if interrupt_email_sort = true then
>>> interrupt_email_sort = false
>>> result2 = messagebox("Pause...","Do you want to stop this
>>> process?",Exclamation!, OKCancel!, 2)
>>> if result2 = 1 then
>>> cb_6.hide()
>>> exit
>>> end if
>>> else
>>>
>>> i_email = dw_1.getitemstring(i,"email_address")
>>>
>>> #if defined PBWINFORM then
>>>
>>> //[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple =
>>> false, Inherited = false)] public sealed class LicenseProviderAttribute
>>> :
>>> Attribute
>>>
>>> Dart.PowerTCP.EmailValidation.Validator validator1
>>> validator1 = Create Dart.PowerTCP.EmailValidation.Validator
>>>
>>> //Validate to the final level
>>> //Damn, you have to add the '!' to the end of an enumeration (whatever
>>> that is). I guess it is a CHOICE.
>>> validator1.ValidationLevel =
>>> Dart.PowerTCP.EmailValidation.ValidationLevel.SmtpRecipient!
>>>
>>> //DNS settings
>>> validator1.Dns.RotateServers = FALSE //always start with first server
>>> THIS IS LINE 46 PER THE ERRORS BELOW.
>>> validator1.Dns.Retries = 2; //try up to 3 times
>>> validator1.Dns.Timeout = 5000; //5 seconds
>>>
>>> //SMTP settings
>>> //validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>>> validator1.Smtp.MailFrom = "pemurray@staysystems.com"; //required
>>> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>>> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>>
>>> //Validate and return the result
>>> //ValidationState result = validator1.Validate(emailAddress);
>>> ValidationState result = validator1.Validate(i_email);
>>> string email_result, progress, exception_level
>>> email_result = result.EmailAddress
>>> progress = result.Progress.ToString()
>>> exception_level = result.Exception
>>> // ? "The validation was successful."
>>> // : "The following exception occurred: " +
>>> result.Exception.ToString();
>>>
>>> //Return description
>>> messagebox("INSIDE LOOP INSIDE pbwinform","Row " + string(i) + " of "
>>> +
>>> string(rows))
>>> messagebox("email_result",email_result)
>>> messagebox("progress",progress)
>>> messagebox("exception_level",exception_level)
>>>
>>> #end if
>>> end if
>>>
>>> next
>>>
>>> /////////////////////////////////END DART EMAIL VALIDATION
>>> TEST///////////////////////////////////
>>>
>>> ---------- Error messages: (00:53:29 )
>>> c:\documents and settings\administrator\my
>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.46
>>> C0143: A privatewrite property can be modified only in an event or
>>> function in its parent class.
>>> c:\documents and settings\administrator\my
>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.47
>>> C0143: A privatewrite property can be modified only in an event or
>>> function in its parent class.
>>> c:\documents and settings\administrator\my
>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.48
>>> C0143: A privatewrite property can be modified only in an event or
>>> function in its parent class.
>>> c:\documents and settings\administrator\my
>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.52
>>> C0143: A privatewrite property can be modified only in an event or
>>> function in its parent class.
>>> c:\documents and settings\administrator\my
>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.53
>>> C0143: A privatewrite property can be modified only in an event or
>>> function in its parent class.
>>> c:\documents and settings\administrator\my
>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.54
>>> C0143: A privatewrite property can be modified only in an event or
>>> function in its parent class.
>>> c:\documents and settings\administrator\my
>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.58
>>> C0001: Illegal data type: validationstate.
>>> c:\documents and settings\administrator\my
>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.60
>>> C0018: Cannot use dot operator on expression of undetermined type.
>>> c:\documents and settings\administrator\my
>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.61
>>> C0018: Cannot use dot operator on expression of undetermined type.
>>> c:\documents and settings\administrator\my
>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.62
>>> C0018: Cannot use dot operator on expression of undetermined type.
>>> ---------- Finished (00:53:29 )
>>>
>>>
>>> ************
>>> "Paul Murray" <pemurray@staysystems.com> wrote in message
>>> news:495992b5$1@forums-1-dub...
>>>> Dear friends,
>>>>
>>>> I am trialing an email validation component from Dart. The example
>>>> code
>>>> to call the component is available in either C# or VB and is displayed
>>>> below.
>>>>
>>>> 1) I would like to get some help translating it to run in an '#IF
>>>> PBWINFORM' block of code.
>>>> 2) I would really like some insight as to what is the process by which
>>>> code has to be changed over to PB syntax so that I can do it myself as
>>>> there are other functions that I want to implement. OR, is it possible
>>>> to simply insert C# code and PB will use as it ultimately generates C#
>>>> code anyway for the deployed code?
>>>>
>>>> As to the two examples below, the C# code at least looks much more like
>>>> PB syntax than the VB code.
>>>>
>>>> Thank you!!!
>>>>
>>>> Paul
>>>>
>>>> C#]
>>>>
>>>> private string doValidation(string emailAddress)
>>>> {
>>>> //Add "using Dart.PowerTCP.EmailValidation;" at the top
>>>>
>>>> //Validate to the final level
>>>> validator1.ValidationLevel = ValidationLevel.SmtpRecipient;
>>>>
>>>> //DNS settings
>>>> validator1.Dns.RotateServers = false; //always start with first
>>>> server
>>>> validator1.Dns.Retries = 2; //try up to 3 times
>>>> validator1.Dns.Timeout = 5000; //5 seconds
>>>>
>>>> //SMTP settings
>>>> validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>>>> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>>>> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>>>
>>>> //Validate and return the result
>>>> ValidationState result = validator1.Validate(emailAddress);
>>>> string description = "The validation of " + result.EmailAddress + "
>>>> proceeded to the ";
>>>> description += result.Progress.ToString() + " level. ";
>>>> description += (result.Exception == null)
>>>> ? "The validation was successful."
>>>> : "The following exception occurred: " +
>>>> result.Exception.ToString();
>>>> return description;
>>>> }
>>>>
>>>>
>>>> [Visual Basic]
>>>>
>>>> Private Function doValidation(ByVal emailAddress As String) As String
>>>> 'Add "Imports Dart.PowerTCP.EmailValidation" at the top
>>>>
>>>> 'Validate to the final level
>>>> Validator1.ValidationLevel = ValidationLevel.SmtpRecipient
>>>>
>>>> 'DNS settings
>>>> Validator1.Dns.RotateServers = False 'always start with first server
>>>> Validator1.Dns.Retries = 2 'try up to 3 times
>>>> Validator1.Dns.Timeout = 5000 '5 seconds
>>>>
>>>> 'SMTP settings
>>>> Validator1.Smtp.MailFrom = "myAccount@myDomain.com" 'required
>>>> Validator1.Smtp.ConnectTimeout = 40000 '40 seconds
>>>> Validator1.Smtp.ReceiveTimeout = 40000 '40 seconds
>>>>
>>>> 'Validate and return the result
>>>> Dim result As ValidationState = Validator1.Validate(emailAddress)
>>>> Dim description As String = "The validation of " +
>>>> result.EmailAddress
>>>> + " proceeded to the "
>>>> description += result.Progress.ToString() + " level. "
>>>> If (result.Exception Is Nothing) Then
>>>> description += "The validation was successful."
>>>> Else
>>>> description += "The following exception occurred: " +
>>>> result.Exception.ToString()
>>>> End If
>>>> Return description
>>>> End Function
>>>>
>>>
>>>
>>
>>
>
>
>


Paul Murray Posted on 2008-12-30 19:05:39.0Z
From: "Paul Murray" <pemurray@staysystems.com>
Newsgroups: sybase.public.powerbuilder.net.winform
References: <495992b5$1@forums-1-dub> <4959bcc9@forums-1-dub> <495a5ae7@forums-1-dub> <495a5e67@forums-1-dub> <495a66ac@forums-1-dub>
Subject: Re: Translating C# to PowerBuilder Syntax - Made a little progress...
Lines: 320
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <495a7103@forums-1-dub>
Date: 30 Dec 2008 11:05:39 -0800
X-Trace: forums-1-dub 1230663939 10.22.241.152 (30 Dec 2008 11:05:39 -0800)
X-Original-Trace: 30 Dec 2008 11:05:39 -0800, vip152.sybase.com
X-Authenticated-User: pb110beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:755
Article PK: 707486

Also, why is the DNS property defined as Public ReadOnly? Is that something
Dart does? Or is there a way to change that during the instantiation of the
class(or whatever it is called)?

"Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
news:495a66ac@forums-1-dub...
>I stand corrected!
>
> The DNS property is defined as Public ReadOnly (which PB evaluates as
> PrivateWrite).
> The RotateServers property of the DNS structure is Public.
>
> So I don't think you can update validator1.DNS.properties directly. You
> may have to do it in two stages.
> Try this.
> Dart.PowerTCP.EmailValidation.Validator validator1
> validator1 = Create Dart.PowerTCP.EmailValidation.Validator
>
> Dart.PowerTCP.EmailValidation.Validator.DNS DNS1
> DNS1 = validator1.DNS
>
> DNS1.RotateServers = FALSE
>
> That might help...
>
> --
> Paul Horan[Sybase]
> paulhoran.pbdjmagazine.com
>
> "Paul Murray" <pemurray@staysystems.com> wrote in message
> news:495a5e67@forums-1-dub...
>> Hi Paul,
>>
>> Thanks for your help!! And thanks for going the extra mile and
>> installing the .NET assembly in question.
>>
>> I am using PB 11.2 Build 8616.
>>
>> While I am getting lots of errors, it appears that the first instance of
>> the error is here (see attached screen shot):
>>
>> validator1.Dns.RotateServers = FALSE //always start with first server
>>
>> The associated error is:
>>
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl
>> (w_manage_scrub_list).cb_10.clicked.46 C0143: A privatewrite property can
>> be modified only in an event or function in its parent class.
>>
>> Thanks again!
>>
>> Paul
>>
>> "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
>> news:495a5ae7@forums-1-dub...
>>> What version of PB are you using?
>>> Which line of code causes this error?
>>>
>>> I downloaded and installed that .Net assembly, and all the properties
>>> and
>>> methods show as PUBLIC, so I'm not sure why you're seeing them as
>>> PrivateWrite...
>>>
>>> --
>>> Paul Horan[Sybase]
>>> paulhoran.pbdjmagazine.com
>>>
>>> "Paul Murray" <pemurray@staysystems.com> wrote in message
>>> news:4959bcc9@forums-1-dub...
>>>> Hi All,
>>>>
>>>> I made a little progress by figuring out that one of the properties was
>>>> enumerated and I had to add an '!' to the end of it. Now I am getting
>>>> an
>>>> error as follows when I try to set a property. I have a lot of these
>>>> errors.:
>>>>
>>>> "A privatewrite property can be modified only in an event or function
>>>> in
>>>> its parent class."
>>>>
>>>> So I was thinking, should I be creating this a function of custom class
>>>> or
>>>> something like that?
>>>>
>>>> Thanks All!!
>>>>
>>>> Paul
>>>>
>>>> /////////////////////////////////START DART EMAIL VALIDATION
>>>> TEST///////////////////////////////////
>>>> //long rows
>>>> rows = dw_1.rowcount()
>>>>
>>>> messagebox("START","Number of rows is: " + string(rows))
>>>>
>>>> string i_email
>>>> string validationstate
>>>> string validationresult
>>>> //string i_validationlevel
>>>> //i_validationlevel = "SmtpRecipient"
>>>> long i
>>>>
>>>> for i = 1 to rows
>>>> yield()
>>>> if interrupt_email_sort = true then
>>>> interrupt_email_sort = false
>>>> result2 = messagebox("Pause...","Do you want to stop this
>>>> process?",Exclamation!, OKCancel!, 2)
>>>> if result2 = 1 then
>>>> cb_6.hide()
>>>> exit
>>>> end if
>>>> else
>>>>
>>>> i_email = dw_1.getitemstring(i,"email_address")
>>>>
>>>> #if defined PBWINFORM then
>>>>
>>>> //[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple =
>>>> false, Inherited = false)] public sealed class LicenseProviderAttribute
>>>> :
>>>> Attribute
>>>>
>>>> Dart.PowerTCP.EmailValidation.Validator validator1
>>>> validator1 = Create Dart.PowerTCP.EmailValidation.Validator
>>>>
>>>> //Validate to the final level
>>>> //Damn, you have to add the '!' to the end of an enumeration
>>>> (whatever
>>>> that is). I guess it is a CHOICE.
>>>> validator1.ValidationLevel =
>>>> Dart.PowerTCP.EmailValidation.ValidationLevel.SmtpRecipient!
>>>>
>>>> //DNS settings
>>>> validator1.Dns.RotateServers = FALSE //always start with first server
>>>> THIS IS LINE 46 PER THE ERRORS BELOW.
>>>> validator1.Dns.Retries = 2; //try up to 3 times
>>>> validator1.Dns.Timeout = 5000; //5 seconds
>>>>
>>>> //SMTP settings
>>>> //validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>>>> validator1.Smtp.MailFrom = "pemurray@staysystems.com"; //required
>>>> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>>>> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>>>
>>>> //Validate and return the result
>>>> //ValidationState result = validator1.Validate(emailAddress);
>>>> ValidationState result = validator1.Validate(i_email);
>>>> string email_result, progress, exception_level
>>>> email_result = result.EmailAddress
>>>> progress = result.Progress.ToString()
>>>> exception_level = result.Exception
>>>> // ? "The validation was successful."
>>>> // : "The following exception occurred: " +
>>>> result.Exception.ToString();
>>>>
>>>> //Return description
>>>> messagebox("INSIDE LOOP INSIDE pbwinform","Row " + string(i) + " of "
>>>> +
>>>> string(rows))
>>>> messagebox("email_result",email_result)
>>>> messagebox("progress",progress)
>>>> messagebox("exception_level",exception_level)
>>>>
>>>> #end if
>>>> end if
>>>>
>>>> next
>>>>
>>>> /////////////////////////////////END DART EMAIL VALIDATION
>>>> TEST///////////////////////////////////
>>>>
>>>> ---------- Error messages: (00:53:29 )
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.46
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.47
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.48
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.52
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.53
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.54
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.58
>>>> C0001: Illegal data type: validationstate.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.60
>>>> C0018: Cannot use dot operator on expression of undetermined type.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.61
>>>> C0018: Cannot use dot operator on expression of undetermined type.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.62
>>>> C0018: Cannot use dot operator on expression of undetermined type.
>>>> ---------- Finished (00:53:29 )
>>>>
>>>>
>>>> ************
>>>> "Paul Murray" <pemurray@staysystems.com> wrote in message
>>>> news:495992b5$1@forums-1-dub...
>>>>> Dear friends,
>>>>>
>>>>> I am trialing an email validation component from Dart. The example
>>>>> code
>>>>> to call the component is available in either C# or VB and is displayed
>>>>> below.
>>>>>
>>>>> 1) I would like to get some help translating it to run in an '#IF
>>>>> PBWINFORM' block of code.
>>>>> 2) I would really like some insight as to what is the process by which
>>>>> code has to be changed over to PB syntax so that I can do it myself as
>>>>> there are other functions that I want to implement. OR, is it
>>>>> possible
>>>>> to simply insert C# code and PB will use as it ultimately generates C#
>>>>> code anyway for the deployed code?
>>>>>
>>>>> As to the two examples below, the C# code at least looks much more
>>>>> like
>>>>> PB syntax than the VB code.
>>>>>
>>>>> Thank you!!!
>>>>>
>>>>> Paul
>>>>>
>>>>> C#]
>>>>>
>>>>> private string doValidation(string emailAddress)
>>>>> {
>>>>> //Add "using Dart.PowerTCP.EmailValidation;" at the top
>>>>>
>>>>> //Validate to the final level
>>>>> validator1.ValidationLevel = ValidationLevel.SmtpRecipient;
>>>>>
>>>>> //DNS settings
>>>>> validator1.Dns.RotateServers = false; //always start with first
>>>>> server
>>>>> validator1.Dns.Retries = 2; //try up to 3 times
>>>>> validator1.Dns.Timeout = 5000; //5 seconds
>>>>>
>>>>> //SMTP settings
>>>>> validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>>>>> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>>>>> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>>>>
>>>>> //Validate and return the result
>>>>> ValidationState result = validator1.Validate(emailAddress);
>>>>> string description = "The validation of " + result.EmailAddress + "
>>>>> proceeded to the ";
>>>>> description += result.Progress.ToString() + " level. ";
>>>>> description += (result.Exception == null)
>>>>> ? "The validation was successful."
>>>>> : "The following exception occurred: " +
>>>>> result.Exception.ToString();
>>>>> return description;
>>>>> }
>>>>>
>>>>>
>>>>> [Visual Basic]
>>>>>
>>>>> Private Function doValidation(ByVal emailAddress As String) As String
>>>>> 'Add "Imports Dart.PowerTCP.EmailValidation" at the top
>>>>>
>>>>> 'Validate to the final level
>>>>> Validator1.ValidationLevel = ValidationLevel.SmtpRecipient
>>>>>
>>>>> 'DNS settings
>>>>> Validator1.Dns.RotateServers = False 'always start with first
>>>>> server
>>>>> Validator1.Dns.Retries = 2 'try up to 3 times
>>>>> Validator1.Dns.Timeout = 5000 '5 seconds
>>>>>
>>>>> 'SMTP settings
>>>>> Validator1.Smtp.MailFrom = "myAccount@myDomain.com" 'required
>>>>> Validator1.Smtp.ConnectTimeout = 40000 '40 seconds
>>>>> Validator1.Smtp.ReceiveTimeout = 40000 '40 seconds
>>>>>
>>>>> 'Validate and return the result
>>>>> Dim result As ValidationState = Validator1.Validate(emailAddress)
>>>>> Dim description As String = "The validation of " +
>>>>> result.EmailAddress
>>>>> + " proceeded to the "
>>>>> description += result.Progress.ToString() + " level. "
>>>>> If (result.Exception Is Nothing) Then
>>>>> description += "The validation was successful."
>>>>> Else
>>>>> description += "The following exception occurred: " +
>>>>> result.Exception.ToString()
>>>>> End If
>>>>> Return description
>>>>> End Function
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>


Paul Murray Posted on 2008-12-31 02:39:29.0Z
From: "Paul Murray" <pemurray@staysystems.com>
Newsgroups: sybase.public.powerbuilder.net.winform
References: <495992b5$1@forums-1-dub> <4959bcc9@forums-1-dub> <495a5ae7@forums-1-dub> <495a5e67@forums-1-dub> <495a66ac@forums-1-dub> <495a7103@forums-1-dub>
Subject: Re: Translating C# to PowerBuilder Syntax - Made a little progress...
Lines: 928
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_02B4_01C96AC7.69F415D0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <495adb61@forums-1-dub>
Date: 30 Dec 2008 18:39:29 -0800
X-Trace: forums-1-dub 1230691169 10.22.241.152 (30 Dec 2008 18:39:29 -0800)
X-Original-Trace: 30 Dec 2008 18:39:29 -0800, vip152.sybase.com
X-Authenticated-User: pb110beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:756
Article PK: 707491

I see a post called "privatewrite property issue" from Ganesh on 5/13/2008.  Seems like he had a similar issue.  It ended with him hoping the issue would be fixed soon.  I just downloaded the latest ebf for 11.2 and installed it (8669).  That did not resolve my problem.
 
I checked with the creator of the .NET component and got this message back:
 
It has always been permissable in the MS languages to have a read-only property with sub-properties that are read-write.  It just means that you cannot create a new instance of the data type (in this case a Dns component or SmtpTester class) and set the property to it.
Paul Horan's post stating, "The DNS property is defined as Public ReadOnly  (which PB evaluates as PrivateWrite). The RotateServers property of the DNS structure is Public." suggests to me that PowerBuilder is looking at the top level property of the .NET assembly and 'assuming' that all of the lower level properties have the same ReadOnly property.
 
Who knows?  I am not an expert at this.
 
But I would certainly appreciate anyone's help with respect to figuring out how I can use this Dart .NET assembly.  Likewise, if someone can point me to another .NET email validation assembly that works with PB, I would be happy to take a look at it.
 
Thanks to all,
 
Paul

 
 
"Paul Murray" <pemurray@staysystems.com> wrote in message news:495a7103@forums-1-dub...
> Also, why is the DNS property defined as Public ReadOnly?  Is that something
> Dart does?  Or is there a way to change that during the instantiation of the
> class(or whatever it is called)?
>
>
> "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
> news:495a66ac@forums-1-dub...
>>I stand corrected!
>>
>> The DNS property is defined as Public ReadOnly  (which PB evaluates as
>> PrivateWrite).
>> The RotateServers property of the DNS structure is Public.
>>
>> So I don't think you can update validator1.DNS.properties directly.  You
>> may have to do it in two stages.
>> Try this.
>> Dart.PowerTCP.EmailValidation.Validator   validator1
>> validator1 = Create Dart.PowerTCP.EmailValidation.Validator
>>
>> Dart.PowerTCP.EmailValidation.Validator.DNS  DNS1
>> DNS1 = validator1.DNS
>>
>> DNS1.RotateServers = FALSE
>>
>> That might help...
>>
>> --
>> Paul Horan[Sybase]
>> paulhoran.pbdjmagazine.com
>>
>> "Paul Murray" <pemurray@staysystems.com> wrote in message
>> news:495a5e67@forums-1-dub...
>>> Hi Paul,
>>>
>>> Thanks for your help!!  And thanks for going the extra mile and
>>> installing the .NET assembly in question.
>>>
>>> I am using PB 11.2 Build 8616.
>>>
>>> While I am getting lots of errors, it appears that the first instance of
>>> the error is here (see attached screen shot):
>>>
>>> validator1.Dns.RotateServers = FALSE //always start with first server
>>>
>>> The associated error is:
>>>
>>> c:\documents and settings\administrator\my
>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl
>>> (w_manage_scrub_list).cb_10.clicked.46 C0143: A privatewrite property can
>>> be modified only in an event or function in its parent class.
>>>
>>> Thanks again!
>>>
>>> Paul
>>>
>>> "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
>>> news:495a5ae7@forums-1-dub...
>>>> What version of PB are you using?
>>>> Which line of code causes this error?
>>>>
>>>> I downloaded and installed that .Net assembly, and all the properties
>>>> and
>>>> methods show as PUBLIC, so I'm not sure why you're seeing them as
>>>> PrivateWrite...
>>>>
>>>> --
>>>> Paul Horan[Sybase]
>>>> paulhoran.pbdjmagazine.com
>>>>
>>>> "Paul Murray" <pemurray@staysystems.com> wrote in message
>>>> news:4959bcc9@forums-1-dub...
>>>>> Hi All,
>>>>>
>>>>> I made a little progress by figuring out that one of the properties was
>>>>> enumerated and I had to add an '!' to the end of it.  Now I am getting
>>>>> an
>>>>> error as follows when I try to set a property.  I have a lot of these
>>>>> errors.:
>>>>>
>>>>> "A privatewrite property can be modified only in an event or function
>>>>> in
>>>>> its parent class."
>>>>>
>>>>> So I was thinking, should I be creating this a function of custom class
>>>>> or
>>>>> something like that?
>>>>>
>>>>> Thanks All!!
>>>>>
>>>>> Paul
>>>>>
>>>>> /////////////////////////////////START DART EMAIL VALIDATION
>>>>> TEST///////////////////////////////////
>>>>> //long rows
>>>>> rows = dw_1.rowcount()
>>>>>
>>>>> messagebox("START","Number of rows is: " + string(rows))
>>>>>
>>>>> string i_email
>>>>> string validationstate
>>>>> string validationresult
>>>>> //string i_validationlevel
>>>>> //i_validationlevel = "SmtpRecipient"
>>>>> long i
>>>>>
>>>>> for i = 1 to rows
>>>>> yield()
>>>>> if interrupt_email_sort = true then
>>>>>  interrupt_email_sort = false
>>>>>  result2 = messagebox("Pause...","Do you want to stop this
>>>>> process?",Exclamation!, OKCancel!, 2)
>>>>>  if result2 = 1 then
>>>>>   cb_6.hide()
>>>>>   exit
>>>>>  end if
>>>>> else
>>>>>
>>>>>  i_email = dw_1.getitemstring(i,"email_address")
>>>>>
>>>>>  #if defined PBWINFORM then
>>>>>
>>>>>   //[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple =
>>>>> false, Inherited = false)] public sealed class LicenseProviderAttribute
>>>>> :
>>>>> Attribute
>>>>>
>>>>>   Dart.PowerTCP.EmailValidation.Validator validator1
>>>>>   validator1 = Create Dart.PowerTCP.EmailValidation.Validator
>>>>>
>>>>>   //Validate to the final level
>>>>>   //Damn, you have to add the '!' to the end of an enumeration
>>>>> (whatever
>>>>> that is).  I guess it is a CHOICE.
>>>>>   validator1.ValidationLevel =
>>>>> Dart.PowerTCP.EmailValidation.ValidationLevel.SmtpRecipient!
>>>>>
>>>>>   //DNS settings
>>>>>   validator1.Dns.RotateServers = FALSE //always start with first server
>>>>> THIS IS LINE 46 PER THE ERRORS BELOW.
>>>>>   validator1.Dns.Retries = 2; //try up to 3 times
>>>>>   validator1.Dns.Timeout = 5000; //5 seconds
>>>>>
>>>>>   //SMTP settings
>>>>>   //validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>>>>>   validator1.Smtp.MailFrom = "pemurray@staysystems.com"; //required
>>>>>   validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>>>>>   validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>>>>
>>>>>   //Validate and return the result
>>>>>   //ValidationState result = validator1.Validate(emailAddress);
>>>>>   ValidationState result = validator1.Validate(i_email);
>>>>>   string email_result, progress, exception_level
>>>>>   email_result = result.EmailAddress
>>>>>   progress = result.Progress.ToString()
>>>>>   exception_level = result.Exception
>>>>> //     ? "The validation was successful."
>>>>> //          : "The following exception occurred: " +
>>>>> result.Exception.ToString();
>>>>>
>>>>>    //Return description
>>>>>   messagebox("INSIDE LOOP INSIDE pbwinform","Row " + string(i) + " of "
>>>>> +
>>>>> string(rows))
>>>>>   messagebox("email_result",email_result)
>>>>>   messagebox("progress",progress)
>>>>>   messagebox("exception_level",exception_level)
>>>>>
>>>>>  #end if
>>>>> end if
>>>>>
>>>>> next
>>>>>
>>>>> /////////////////////////////////END DART EMAIL VALIDATION
>>>>> TEST///////////////////////////////////
>>>>>
>>>>> ---------- Error messages:    (00:53:29 )
>>>>> c:\documents and settings\administrator\my
>>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.46
>>>>> C0143: A privatewrite property can be modified only in an event or
>>>>> function in its parent class.
>>>>> c:\documents and settings\administrator\my
>>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.47
>>>>> C0143: A privatewrite property can be modified only in an event or
>>>>> function in its parent class.
>>>>> c:\documents and settings\administrator\my
>>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.48
>>>>> C0143: A privatewrite property can be modified only in an event or
>>>>> function in its parent class.
>>>>> c:\documents and settings\administrator\my
>>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.52
>>>>> C0143: A privatewrite property can be modified only in an event or
>>>>> function in its parent class.
>>>>> c:\documents and settings\administrator\my
>>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.53
>>>>> C0143: A privatewrite property can be modified only in an event or
>>>>> function in its parent class.
>>>>> c:\documents and settings\administrator\my
>>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.54
>>>>> C0143: A privatewrite property can be modified only in an event or
>>>>> function in its parent class.
>>>>> c:\documents and settings\administrator\my
>>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.58
>>>>> C0001: Illegal data type: validationstate.
>>>>> c:\documents and settings\administrator\my
>>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.60
>>>>> C0018: Cannot use dot operator on expression of undetermined type.
>>>>> c:\documents and settings\administrator\my
>>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.61
>>>>> C0018: Cannot use dot operator on expression of undetermined type.
>>>>> c:\documents and settings\administrator\my
>>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.62
>>>>> C0018: Cannot use dot operator on expression of undetermined type.
>>>>> ---------- Finished    (00:53:29 )
>>>>>
>>>>>
>>>>> ************
>>>>> "Paul Murray" <pemurray@staysystems.com> wrote in message
>>>>> news:495992b5$1@forums-1-dub...
>>>>>> Dear friends,
>>>>>>
>>>>>> I am trialing an email validation component from Dart.  The example
>>>>>> code
>>>>>> to call the component is available in either C# or VB and is displayed
>>>>>> below.
>>>>>>
>>>>>> 1) I would like to get some help translating it to run in an '#IF
>>>>>> PBWINFORM' block of code.
>>>>>> 2) I would really like some insight as to what is the process by which
>>>>>> code has to be changed over to PB syntax so that I can do it myself as
>>>>>> there are other functions that I want to implement.  OR, is it
>>>>>> possible
>>>>>> to simply insert C# code and PB will use as it ultimately generates C#
>>>>>> code anyway for the deployed code?
>>>>>>
>>>>>> As to the two examples below, the C# code at least looks much more
>>>>>> like
>>>>>> PB syntax than the VB code.
>>>>>>
>>>>>> Thank you!!!
>>>>>>
>>>>>> Paul
>>>>>>
>>>>>> C#]
>>>>>>
>>>>>> private string doValidation(string emailAddress)
>>>>>> {
>>>>>>   //Add "using Dart.PowerTCP.EmailValidation;" at the top
>>>>>>
>>>>>>   //Validate to the final level
>>>>>>   validator1.ValidationLevel = ValidationLevel.SmtpRecipient;
>>>>>>
>>>>>>   //DNS settings
>>>>>>   validator1.Dns.RotateServers = false; //always start with first
>>>>>> server
>>>>>>   validator1.Dns.Retries = 2; //try up to 3 times
>>>>>>   validator1.Dns.Timeout = 5000; //5 seconds
>>>>>>
>>>>>>   //SMTP settings
>>>>>>   validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>>>>>>   validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>>>>>>   validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>>>>>
>>>>>>   //Validate and return the result
>>>>>>   ValidationState result = validator1.Validate(emailAddress);
>>>>>>   string description = "The validation of " + result.EmailAddress + "
>>>>>> proceeded to the ";
>>>>>>   description += result.Progress.ToString() + " level. ";
>>>>>>   description += (result.Exception == null)
>>>>>>       ? "The validation was successful."
>>>>>>       : "The following exception occurred: " +
>>>>>> result.Exception.ToString();
>>>>>>   return description;
>>>>>> }
>>>>>>
>>>>>>
>>>>>> [Visual Basic]
>>>>>>
>>>>>> Private Function doValidation(ByVal emailAddress As String) As String
>>>>>>    'Add "Imports Dart.PowerTCP.EmailValidation" at the top
>>>>>>
>>>>>>    'Validate to the final level
>>>>>>    Validator1.ValidationLevel = ValidationLevel.SmtpRecipient
>>>>>>
>>>>>>    'DNS settings
>>>>>>    Validator1.Dns.RotateServers = False 'always start with first
>>>>>> server
>>>>>>    Validator1.Dns.Retries = 2 'try up to 3 times
>>>>>>    Validator1.Dns.Timeout = 5000 '5 seconds
>>>>>>
>>>>>>    'SMTP settings
>>>>>>    Validator1.Smtp.MailFrom = "myAccount@myDomain.com" 'required
>>>>>>    Validator1.Smtp.ConnectTimeout = 40000 '40 seconds
>>>>>>    Validator1.Smtp.ReceiveTimeout = 40000 '40 seconds
>>>>>>
>>>>>>    'Validate and return the result
>>>>>>    Dim result As ValidationState = Validator1.Validate(emailAddress)
>>>>>>    Dim description As String = "The validation of " +
>>>>>> result.EmailAddress
>>>>>> + " proceeded to the "
>>>>>>    description += result.Progress.ToString() + " level. "
>>>>>>    If (result.Exception Is Nothing) Then
>>>>>>        description += "The validation was successful."
>>>>>>    Else
>>>>>>        description += "The following exception occurred: " +
>>>>>> result.Exception.ToString()
>>>>>>    End If
>>>>>>    Return description
>>>>>> End Function
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>


Paul Murray Posted on 2008-12-30 19:03:27.0Z
From: "Paul Murray" <pemurray@staysystems.com>
Newsgroups: sybase.public.powerbuilder.net.winform
References: <495992b5$1@forums-1-dub> <4959bcc9@forums-1-dub> <495a5ae7@forums-1-dub> <495a5e67@forums-1-dub> <495a66ac@forums-1-dub>
Subject: Re: Translating C# to PowerBuilder Syntax - Made a little progress...
Lines: 6751
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <495a707f@forums-1-dub>
Date: 30 Dec 2008 11:03:27 -0800
X-Trace: forums-1-dub 1230663807 10.22.241.152 (30 Dec 2008 11:03:27 -0800)
X-Original-Trace: 30 Dec 2008 11:03:27 -0800, vip152.sybase.com
X-Authenticated-User: pb110beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:754
Article PK: 707500

Hi Paul,

I tried it exactly as you suggested...

I received the following error:

---------- Error messages: (13:59:04 )
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.45
C0001: Illegal data type: dart.powertcp.emailvalidation.validator.dns.
c:\documents and settings\administrator\my
documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.47
C0018: Cannot use dot operator on expression of undetermined type.

Also, I attached a screen shot.

Thank you!!

Paul

"Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
news:495a66ac@forums-1-dub...
>I stand corrected!
>
> The DNS property is defined as Public ReadOnly (which PB evaluates as
> PrivateWrite).
> The RotateServers property of the DNS structure is Public.
>
> So I don't think you can update validator1.DNS.properties directly. You
> may
> have to do it in two stages.
> Try this.
> Dart.PowerTCP.EmailValidation.Validator validator1
> validator1 = Create Dart.PowerTCP.EmailValidation.Validator
>
> Dart.PowerTCP.EmailValidation.Validator.DNS DNS1
> DNS1 = validator1.DNS
>
> DNS1.RotateServers = FALSE
>
> That might help...
>
> --
> Paul Horan[Sybase]
> paulhoran.pbdjmagazine.com
>
> "Paul Murray" <pemurray@staysystems.com> wrote in message
> news:495a5e67@forums-1-dub...
>> Hi Paul,
>>
>> Thanks for your help!! And thanks for going the extra mile and
>> installing
>> the .NET assembly in question.
>>
>> I am using PB 11.2 Build 8616.
>>
>> While I am getting lots of errors, it appears that the first instance of
>> the error is here (see attached screen shot):
>>
>> validator1.Dns.RotateServers = FALSE //always start with first server
>>
>> The associated error is:
>>
>> c:\documents and settings\administrator\my
>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl
>> (w_manage_scrub_list).cb_10.clicked.46 C0143: A privatewrite property can
>> be modified only in an event or function in its parent class.
>>
>> Thanks again!
>>
>> Paul
>>
>> "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
>> news:495a5ae7@forums-1-dub...
>>> What version of PB are you using?
>>> Which line of code causes this error?
>>>
>>> I downloaded and installed that .Net assembly, and all the properties
>>> and
>>> methods show as PUBLIC, so I'm not sure why you're seeing them as
>>> PrivateWrite...
>>>
>>> --
>>> Paul Horan[Sybase]
>>> paulhoran.pbdjmagazine.com
>>>
>>> "Paul Murray" <pemurray@staysystems.com> wrote in message
>>> news:4959bcc9@forums-1-dub...
>>>> Hi All,
>>>>
>>>> I made a little progress by figuring out that one of the properties was
>>>> enumerated and I had to add an '!' to the end of it. Now I am getting
>>>> an
>>>> error as follows when I try to set a property. I have a lot of these
>>>> errors.:
>>>>
>>>> "A privatewrite property can be modified only in an event or function
>>>> in
>>>> its parent class."
>>>>
>>>> So I was thinking, should I be creating this a function of custom class
>>>> or
>>>> something like that?
>>>>
>>>> Thanks All!!
>>>>
>>>> Paul
>>>>
>>>> /////////////////////////////////START DART EMAIL VALIDATION
>>>> TEST///////////////////////////////////
>>>> //long rows
>>>> rows = dw_1.rowcount()
>>>>
>>>> messagebox("START","Number of rows is: " + string(rows))
>>>>
>>>> string i_email
>>>> string validationstate
>>>> string validationresult
>>>> //string i_validationlevel
>>>> //i_validationlevel = "SmtpRecipient"
>>>> long i
>>>>
>>>> for i = 1 to rows
>>>> yield()
>>>> if interrupt_email_sort = true then
>>>> interrupt_email_sort = false
>>>> result2 = messagebox("Pause...","Do you want to stop this
>>>> process?",Exclamation!, OKCancel!, 2)
>>>> if result2 = 1 then
>>>> cb_6.hide()
>>>> exit
>>>> end if
>>>> else
>>>>
>>>> i_email = dw_1.getitemstring(i,"email_address")
>>>>
>>>> #if defined PBWINFORM then
>>>>
>>>> //[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple =
>>>> false, Inherited = false)] public sealed class LicenseProviderAttribute
>>>> :
>>>> Attribute
>>>>
>>>> Dart.PowerTCP.EmailValidation.Validator validator1
>>>> validator1 = Create Dart.PowerTCP.EmailValidation.Validator
>>>>
>>>> //Validate to the final level
>>>> //Damn, you have to add the '!' to the end of an enumeration
>>>> (whatever
>>>> that is). I guess it is a CHOICE.
>>>> validator1.ValidationLevel =
>>>> Dart.PowerTCP.EmailValidation.ValidationLevel.SmtpRecipient!
>>>>
>>>> //DNS settings
>>>> validator1.Dns.RotateServers = FALSE //always start with first server
>>>> THIS IS LINE 46 PER THE ERRORS BELOW.
>>>> validator1.Dns.Retries = 2; //try up to 3 times
>>>> validator1.Dns.Timeout = 5000; //5 seconds
>>>>
>>>> //SMTP settings
>>>> //validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>>>> validator1.Smtp.MailFrom = "pemurray@staysystems.com"; //required
>>>> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>>>> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>>>
>>>> //Validate and return the result
>>>> //ValidationState result = validator1.Validate(emailAddress);
>>>> ValidationState result = validator1.Validate(i_email);
>>>> string email_result, progress, exception_level
>>>> email_result = result.EmailAddress
>>>> progress = result.Progress.ToString()
>>>> exception_level = result.Exception
>>>> // ? "The validation was successful."
>>>> // : "The following exception occurred: " +
>>>> result.Exception.ToString();
>>>>
>>>> //Return description
>>>> messagebox("INSIDE LOOP INSIDE pbwinform","Row " + string(i) + " of "
>>>> +
>>>> string(rows))
>>>> messagebox("email_result",email_result)
>>>> messagebox("progress",progress)
>>>> messagebox("exception_level",exception_level)
>>>>
>>>> #end if
>>>> end if
>>>>
>>>> next
>>>>
>>>> /////////////////////////////////END DART EMAIL VALIDATION
>>>> TEST///////////////////////////////////
>>>>
>>>> ---------- Error messages: (00:53:29 )
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.46
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.47
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.48
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.52
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.53
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.54
>>>> C0143: A privatewrite property can be modified only in an event or
>>>> function in its parent class.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.58
>>>> C0001: Illegal data type: validationstate.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.60
>>>> C0018: Cannot use dot operator on expression of undetermined type.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.61
>>>> C0018: Cannot use dot operator on expression of undetermined type.
>>>> c:\documents and settings\administrator\my
>>>> documents\!interrasys\!dev\emailmanager\emailmanager.pbl(w_manage_scrub_list).cb_10.clicked.62
>>>> C0018: Cannot use dot operator on expression of undetermined type.
>>>> ---------- Finished (00:53:29 )
>>>>
>>>>
>>>> ************
>>>> "Paul Murray" <pemurray@staysystems.com> wrote in message
>>>> news:495992b5$1@forums-1-dub...
>>>>> Dear friends,
>>>>>
>>>>> I am trialing an email validation component from Dart. The example
>>>>> code
>>>>> to call the component is available in either C# or VB and is displayed
>>>>> below.
>>>>>
>>>>> 1) I would like to get some help translating it to run in an '#IF
>>>>> PBWINFORM' block of code.
>>>>> 2) I would really like some insight as to what is the process by which
>>>>> code has to be changed over to PB syntax so that I can do it myself as
>>>>> there are other functions that I want to implement. OR, is it
>>>>> possible
>>>>> to simply insert C# code and PB will use as it ultimately generates C#
>>>>> code anyway for the deployed code?
>>>>>
>>>>> As to the two examples below, the C# code at least looks much more
>>>>> like
>>>>> PB syntax than the VB code.
>>>>>
>>>>> Thank you!!!
>>>>>
>>>>> Paul
>>>>>
>>>>> C#]
>>>>>
>>>>> private string doValidation(string emailAddress)
>>>>> {
>>>>> //Add "using Dart.PowerTCP.EmailValidation;" at the top
>>>>>
>>>>> //Validate to the final level
>>>>> validator1.ValidationLevel = ValidationLevel.SmtpRecipient;
>>>>>
>>>>> //DNS settings
>>>>> validator1.Dns.RotateServers = false; //always start with first
>>>>> server
>>>>> validator1.Dns.Retries = 2; //try up to 3 times
>>>>> validator1.Dns.Timeout = 5000; //5 seconds
>>>>>
>>>>> //SMTP settings
>>>>> validator1.Smtp.MailFrom = "myAccount@myDomain.com"; //required
>>>>> validator1.Smtp.ConnectTimeout = 40000; //40 seconds
>>>>> validator1.Smtp.ReceiveTimeout = 40000; //40 seconds
>>>>>
>>>>> //Validate and return the result
>>>>> ValidationState result = validator1.Validate(emailAddress);
>>>>> string description = "The validation of " + result.EmailAddress + "
>>>>> proceeded to the ";
>>>>> description += result.Progress.ToString() + " level. ";
>>>>> description += (result.Exception == null)
>>>>> ? "The validation was successful."
>>>>> : "The following exception occurred: " +
>>>>> result.Exception.ToString();
>>>>> return description;
>>>>> }
>>>>>
>>>>>
>>>>> [Visual Basic]
>>>>>
>>>>> Private Function doValidation(ByVal emailAddress As String) As String
>>>>> 'Add "Imports Dart.PowerTCP.EmailValidation" at the top
>>>>>
>>>>> 'Validate to the final level
>>>>> Validator1.ValidationLevel = ValidationLevel.SmtpRecipient
>>>>>
>>>>> 'DNS settings
>>>>> Validator1.Dns.RotateServers = False 'always start with first
>>>>> server
>>>>> Validator1.Dns.Retries = 2 'try up to 3 times
>>>>> Validator1.Dns.Timeout = 5000 '5 seconds
>>>>>
>>>>> 'SMTP settings
>>>>> Validator1.Smtp.MailFrom = "myAccount@myDomain.com" 'required
>>>>> Validator1.Smtp.ConnectTimeout = 40000 '40 seconds
>>>>> Validator1.Smtp.ReceiveTimeout = 40000 '40 seconds
>>>>>
>>>>> 'Validate and return the result
>>>>> Dim result As ValidationState = Validator1.Validate(emailAddress)
>>>>> Dim description As String = "The validation of " +
>>>>> result.EmailAddress
>>>>> + " proceeded to the "
>>>>> description += result.Progress.ToString() + " level. "
>>>>> If (result.Exception Is Nothing) Then
>>>>> description += "The validation was successful."
>>>>> Else
>>>>> description += "The following exception occurred: " +
>>>>> result.Exception.ToString()
>>>>> End If
>>>>> Return description
>>>>> End Function
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>

DART  DOT NET ERROR2.jpg