Page MenuHomeFeedback Tracker

One line comments sometimes block the read of the file.
Closed, ResolvedPublic

Description

Sometimes when I use "//" comments the reading of the file just stop. The file format is *.SQF, and in other files the one line comments work fine, but sometimes they not.

This is not work:
//Thats a comment

That's work:
/*
//Thats a comment
*/

I got the same issue even if the file just contain 3 line, one comment and two "hint" message. Problem happening with Stable and Dev version too.
{F19237}

Details

Legacy ID
1941145830
Severity
None
Resolution
Not A Bug
Reproducibility
Sometimes
Category
Scripting
Steps To Reproduce

Later I will upload a test file about this problem.

Event Timeline

Unknown Object (User) edited Steps To Reproduce. (Show Details)May 2 2013, 4:18 PM
Unknown Object (User) edited Additional Information. (Show Details)
Unknown Object (User) set Category to Scripting.
Unknown Object (User) set Reproducibility to Sometimes.
Unknown Object (User) set Severity to None.
Unknown Object (User) set Resolution to Not A Bug.
Unknown Object (User) set Legacy ID to 1941145830.May 7 2016, 1:57 PM
Bohemia added a subscriber: Twix.May 2 2013, 4:18 PM

How are you executing the script?

Unknown Object (User) added a subscriber: Unknown Object (User).May 7 2016, 1:57 PM
Unknown Object (User) added a comment.May 2 2013, 8:22 PM

MulleDK19: I executed it from action/scroll menu. Usualy for testing I use action menus in the init field of the soldier, in this style: this addAction ["action1", "action1.sqf"];

The file actually start to run, but as soon as it reach the first "//" comment line it's stop running/stuck. If i remove the line, or just put it into another comment (/* */) then the file exeuted well, without any problem.

Twix added a comment.May 2 2013, 8:44 PM

Similar issue happened to me once, hopefully that can solve it: Make sure the proper CR and LF characters are there.

  • If you have a text editor that allows displaying the characters, activate it (ie in notepad ++ : in menu View > Symbols > Show all character.)
  • If not, open up your regular notepad (not word, or anything richtext) and re-type (do NOT copy/paste) your file then save it and use this one.
  • In doubt, attach your sqf file here.

Please attach the script, I have never seen anything like this.

Unknown Object (User) added a comment.May 3 2013, 10:48 AM

Problem solved, thanks Twix. The situation was the following:

As Twix said, the text files have two hidden/invisible symbol at end of every line. Those symbols are the "CR" and "LF". (Here is a list of all tose symvols: https://en.wikipedia.org/wiki/Device_Control_1#C0_.28ASCII_and_derivatives.29 ) The file that coused the error onyl had "CR" (MAC format) at the line ends. So this mean the file was "one line long" for the applications while it has multiple lines.

When editing/scripting I usualy create *.txt file, and then change the type and name manually. Maybe I miss-clicked and created a word file, and this coused the problem. I also attached my file, so you can check it too.

How to solve the problem:

  1. Way One
    • (As Twix said) Create a new file, and rewrite it word by word (no copy-paste).
  2. Way Two
    • (Notepad++) Open your file, go to "Edit" --> "EOL Conversion" --> "Convert to Windows Format". This will fix the actually opened file.

At all, problem solved, coused by user, not related to Arma 3 Alpha, and isse can be closed. I will upload these informations to a BIKI article, maybe it's will be helpfully for some person in the future.

MadDogX added a subscriber: MadDogX.May 7 2016, 1:57 PM

Non-issue, closing.

This comment was removed by Geez.
This comment was removed by Geez.
Geez added a subscriber: Geez.May 7 2019, 1:39 PM