logo
Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Sjarl  
#1 Posted : Thursday, December 10, 2009 1:42:04 PM(UTC)
Sjarl

Rank: Sienn Developer

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 23

Hi,

If you work with a translate database in forms, to translate automatic the fieldheaders (for instance by [[xxx]] tags), you want also the Error messages to be replaced.

To do this, take a look at UserEscape Form Datacheck.
The parameters for this userescape have also an byref array Definition().
Within definition all field behavour is arranged. The array could look like:
Quote:

1#2#Foutmelding#ErrorLabel#Nee#leeg#Nee#GEEN#-1# #Fout#Standaard#Nee #0#
1#2#Headline#Tekst_100#Ja# #Mee#GEEN#-1# #Headline is required#Standaard opmaak#Nee#0#
1#2#NewsText#Tekst8000#Ja# #Mee#GEEN#-1# #News Text#Veld opmaak#Nee#0#
1#2#Button_bevestig#Button#Nee#leeg#Nee#GEEN#-1# #Fout#Standaard#Nee #0#


If you change the errormessages in the field definition to something like [[Error message]].
If you do so, the the definition array looks something like:
Quote:

1#2#Foutmelding#ErrorLabel#Nee#leeg#Nee#GEEN#-1# #Fout#Standaard#Nee #0#
1#2#Headline#Tekst_100#Ja# #Mee#GEEN#-1# #[[Headline is required]]#Standaard opmaak#Nee#0#
1#2#NewsText#Tekst8000#Ja# #Mee#GEEN#-1# #[[News Text]]#Veld opmaak#Nee#0#
1#2#Button_bevestig#Button#Nee#leeg#Nee#GEEN#-1# #Fout#Standaard#Nee #0#


In the UserEscape Form Datacheck you can replace this Error Message by:

Quote:

Select Case FormId
Case 1
Dim RowStartPos as integer = startpos
Dim Fieldcount as integer = 20
Dim i as integer = 0
For i=RowStartPos to RowStartPos + Fieldcount
Try
Dim StartPosError as integer = definition(i).indexof("[[")
Dim EndPosError as integer = definition(i).indexof("]]")
if StartPosError<EndPosError then
Dim ErrorString as string = definition(i).substring(StartPosError+2,EndPosError-StartPosError-2)
Dim NewError as string = "testerror" 'Replace here the translation of ErrorString into NewError by function
definition(i) = definition(i).replace("[[" & ErrorString & "]]",NewError)
end if
Catch
End Try
Next
end select


Of course you have to replace the NewError with an function for finding the translate of the ErrorString.

Wanna join the discussion?! Login to your Sienn Forum forum account. New Registrations are disabled.

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.