1. Michael Turton
  2. PowerServer 2020 or older (Obsolete)
  3. Tuesday, 21 September 2021 14:57 PM UTC

Hi,

I see ContextKeyword is unsupported for PowerServer.   Is there any way to get client Windows system variables (specifically %LOCALAPPDATA%) in PowerServer 2020?   Alternatively, determine programmatically the path of the IWARunner program files on the client?

Thanks,

Michael

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 21 September 2021 15:18 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

Hi Michael;

  The "ContextKeyword" is a client command. It is valid for the Web environment but not for mobile devices.

For example ...

ContextKeyword	lo_cs																								// Context Pointer
sr_pass_data		lo_sr																								// Message structure
Environment		lo_env																							// Environment pointer

lo_ptr		= SetPointer (HourGlass!)																				// Show user 2 wait
IF ib_native_app = TRUE OR  &
	THIS.of_get_client_type( ) = "WEB" THEN																	// Native PB or Web?

	// Various DOS Environment Variable settings by "KeyWord"
	THIS.GetContextService ( "ContextKeyWord", lo_cs)															// YES=>Load pointer to CS object

	ls_keyword	=	"PATH"
	lo_cs.GetContextkeywords ( ls_keyword, ls_values )
	THIS.of_check_context ( ls_values )
	is_system_path	=	ls_values[1]
	ls_msg				=  fn_replace_all ( is_system_path, ";", "; " )
	ls_msg				=	TRIM ( ls_msg )
	// This is a lot of information. Only write this if in DEBUG mode!
	IF	THIS.of_is_debug_mode( ) = TRUE  THEN
		THIS.of_write_log (Space ( 4 )  + ls_keyword + " - " + ls_msg )
	END IF
	
	ls_keyword	=	"USERPROFILE"
	lo_cs.GetContextkeywords ( ls_keyword, ls_values )
	THIS.of_check_context ( ls_values )
	is_user_profile_path	=	ls_values[1]
	IF	THIS.of_is_debug_mode( ) = TRUE  THEN	
		THIS.of_write_log (Space ( 4 )  + ls_keyword + " - " + ls_values [ 1 ] )
	END IF
	

Regards ... Chris

Comment
  1. Michael Turton
  2. Tuesday, 21 September 2021 15:20 PM UTC
Thanks Chris as we only need it for Web I will give it a go.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.