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

Initializing global variables

Explorer ,
Apr 22, 2022 Apr 22, 2022

Copy link to clipboard

Copied

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

Views

455

Translate

Translate

Report

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

correct answers 2 Correct answers

Community Expert , Apr 22, 2022 Apr 22, 2022

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

Votes

Translate

Translate
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.

Votes

Translate

Translate
Community Expert ,
Apr 22, 2022 Apr 22, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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