Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Initializing global variables

Explorer ,
Apr 22, 2022 Apr 22, 2022

Thanks to the help from this community I am getting less inept at javascript programming. Now maybe I can get help one more time.

 

How do I set an "initial value" for a global variable? For example, I need the default value to be "true" as the script begins to run.

 

I hope that question makes sense.

TOPICS
PDF forms
864
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
2 ACCEPTED SOLUTIONS
Community Expert ,
Apr 22, 2022 Apr 22, 2022

Can't you set the variable at the begin of the script?

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 22, 2022 Apr 22, 2022

You can declare variable at Document level.

EDIT: Sorry I missread. As Bernd said declare variable at begining of script or if you need to access variable in different scripts, then use at document level.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 22, 2022 Apr 22, 2022

Can't you set the variable at the begin of the script?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 22, 2022 Apr 22, 2022

You can declare variable at Document level.

EDIT: Sorry I missread. As Bernd said declare variable at begining of script or if you need to access variable in different scripts, then use at document level.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 23, 2022 Apr 23, 2022
LATEST

Yes, I finally figured out how to get some script added at the document level.

 

This is a pretty slick product but the documentation leaves something to be desired. I went through at least a half dozen google hits before one of them used a screen shot to get me to the right place.

 

Thanks for the reply.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines