Skip to main content

TURL_SetUserName (function reference)

By October 1, 2021October 13th, 2021Online Help, Troi URL plug-in
Troi URL Plug-in for FileMaker Pro

TURL_SetUserName

Sets the user name to be used for password protected URLs.

SyntaxFunction badge

TURL_SetUserName ( switches ; username )

Parameters

switches not used, reserved for future use. Leave blank or put "-unused"
username the user name (this is case sensitive)

Returned Result

Data type returned

Error code

Result

If successful this function returns 0. If unsuccessful it returns an error code starting with $$ followed by the error code.

At the moment this function does not return errors.

Originated in

Troi URL Plug-in 1.2

Compatibility

FileMaker Pro 16 to 19

Considerations

The user name is remembered until you specify a different user name. If (for security) you want to remove a previously specified user name, call this function with an empty user name.
The user name is also removed when you quit FileMaker Pro.

The maximum length of a username is 255 characters.

Example

TURL_SetUserName ( "-unused" ; "Tom Poes" )

This will set the user name to “Tom Poes”.

Example 2

This will set the user name and password and get a web page. We assume that in your FileMaker file the following fields are defined:

gUserName         	Global, text
gPassword         	Global, text

gUserName should contain the user name, for example “Olie B. Bommel” and gPassword should contain the password, for example “denkraam”. Add the following script steps:

Set Field [ gErrorCode ; TURL_SetUserName ( "-unused" ;  gUserName ) ]
If [ gErrorCode = 0 ]
	Set Field [ gErrorCode ; TURL_SetPassword ( "-unused" ;  gPassword ) ]
End if
If [ gErrorCode = 0 ]
	Set Field [ gResult ; TURL_Get ( "-NoDialog" ; "http://www.mtvc.nl/" ) ]
	# forget the user name and password
	Set Field [ gErrorCode ; TURL_SetUserName ( "-unused" ;  "" ) ]
	Set Field [ gErrorCode ; TURL_SetPassword ( "-unused" ;  "" ) ]
End if

Related functionFunction badge

TURL_SetPassword

Related topics

Troi URL Plug-in online help (overview)


Online Help Page for Troi URL Plug-in for 16 to 19 –> TURL_SetUserName (urlp4406) 2021-1013 16:38:02