Error on line 1 is marked by a character

Аватара пользователя

flafi

beginner
beginner
Сообщения: 18
Зарегистрирован: 12 апр 2016, 21:39
Версия LabVIEW: 8.5
Контактная информация:

Помогите пожалуйста с Formula Node

Помогите пожалуйста разобраться что не так. Выдает вот такую ошибку Error on line 1 is marked by a ‘#’ character: «if a# = 0 x = 0.25; else if a = 1 x= 0.»

Вложения
formula node.png
formula node.png (8.45 КБ) 2748 просмотров

Borjomy_1

doctor
doctor
Сообщения: 2119
Зарегистрирован: 28 июн 2012, 09:32
Награды: 3
Версия LabVIEW: 2009..2020
Откуда: город семи холмов
Благодарил (а): 20 раз
Поблагодарили: 18 раз

Re: Помогите пожалуйста с Formula Node

Сообщение

Borjomy_1 » 04 фев 2017, 23:12

в C шной нотации для сравнения используется «==», а знак равенства используется для присваивания

но выкидывайте нафиг Node. Это костыли. Для вашей задачи прекрасно подходит структура Case. Для последнего варианта надо дополнительную страничку в кейсе установить как Default. А для каждого значения от 0 до 11 сделать свою страницу, где результату устанавливается нужное значение

или вообще так:

Вложения
замена node.png
замена node.png (19.25 КБ) 2744 просмотра

AndreyDmitriev

VIP
VIP
Сообщения: 1259
Зарегистрирован: 03 фев 2010, 00:42
Награды: 6
Версия LabVIEW: 6.1 — 2022
Откуда: Германия
Поблагодарили: 4 раза
Контактная информация:

Re: Помогите пожалуйста с Formula Node

Сообщение

AndreyDmitriev » 05 фев 2017, 11:05

Borjomy_1 писал(а):в C шной нотации для сравнения используется «==», а знак равенства используется для присваивания
но выкидывайте нафиг Node. Это костыли.

Не выкидывайте нафиг Formula Node, это вполне нормальный код. Помимо второго знака равенства вы ещё и скобки забыли.
Во-первых заведите себе привычку при сравнивании с константой в Си-подобных языках всегда писать константу вперёд, вот так:
Изображение
Тут даже если вы пропустите второй знак равенства — вам немедленно скажет об этом компилятор.
Во-вторых, чуть более элегантно здесь использовать switch структуру:
Изображение
Ну или так, как коллега Borjomy_1 выше написал — тут есть куча всевозможных подходов.

  • 5 Ответы
    789 Просмотры
    Последнее сообщение Artem.spb

    02 мар 2022, 23:37

  • 1 Ответы
    781 Просмотры
    Последнее сообщение Artem.spb

    10 фев 2022, 18:02

  • 5 Ответы
    1135 Просмотры
    Последнее сообщение Borjomy_1

    09 мар 2022, 09:44

  • 5 Ответы
    1086 Просмотры
    Последнее сообщение IvanLis

    17 июн 2022, 18:22

  • 5 Ответы
    592 Просмотры
    Последнее сообщение Artem.spb

    14 июл 2022, 00:33

Recommended Posts

jerseydevil

Newbie

    • Report
    • Share

I have been trying to write LV 6.1 formula nodes and they keep breaking with a nonsense message about the wrong line and needing a left brace. Even simple ones like the attachment do this:

Error on line 1 is marked by a ‘#’ character: «if ( f <# 250 ) CHRL=20; else CHRL=2; P»

First they work, then they don’t work.

I don’t see any info here or at NI. Has any one else seen this?

Download File:post-1810-1111114173.vi

  • Quote

Link to comment

didierj

Newbie

    • Report
    • Share

I have been trying to write LV 6.1 formula nodes and they keep breaking with a nonsense message about the wrong line and needing a left brace. Even simple ones like the attachment do this:

Error on line 1 is marked by a ‘#’ character: «if (  f <# 250 ) CHRL=20; else CHRL=2; P»

First they work, then they don’t work.

I don’t see any info here or at NI. Has any one else seen this?

4258[/snapback]

Your problem lies there, that the formula node requires a single value instead of the array. When using LV6.1 I get a strange error report («Left brace required»???), in LV7.1 the error reports the real problem.

Didier

  • Quote

Link to comment

jerseydevil

Newbie

  • Author
    • Report
    • Share

Your problem lies there, that the formula node requires a single value instead of the array. When using LV6.1 I get a strange error report («Left brace required»???), in LV7.1 the error reports the real problem.

Didier

4260[/snapback]

I still seem to be missing some point. Where is the array in that formila node?

  • Quote

Link to comment

didierj

Newbie

    • Report
    • Share

I still seem to be missing some point. Where is the array in that formila node?

4262[/snapback]

In your example you build an array of 1000 elements which you wire to the input (f) of the formula node.

post-253-1111149905.png?width=400

  • Quote

Link to comment

jerseydevil

Newbie

  • Author
    • Report
    • Share

In your example you build an array of 1000 elements which you wire to the input (f) of the formula node.

post-253-1111149905.png?width=400

4264[/snapback]

Well, thank you for pointing that out. I can see it should be obvious. I’ve got to stop that late night programming, or maybe the company should be hiring younger engineers.

:headbang: :oops:

I think this should conclude this lame post thread, unfortunately I’m not sure how to perform such a feat. Any last minute tips for me?

  • Quote

Link to comment

Join the conversation

You can post now and register later.

If you have an account, sign in now to post with your account.

$(document).ready(function(){
	var imagesCount = 0;
	var maxImages = 6;
	var imagesList = {};
$(function () {
      var $image = $('#image');

      $('#modal').on('shown.bs.modal', function () {
	$('.controls').hide();
	$('.progress').hide();
        $image.cropper({
          built: function () {
          }
        });
      }).on('hidden.bs.modal', function () {
	$('#submit-avatar-button').attr('disabled', 'true');
	$image.attr('src', '');
        $image.cropper('destroy');
      });
	$image.on('load', function(){
	    		$image.cropper({
			aspectRatio: 1,
			crop: function(data){
				var d = $image.cropper('getData');
				d.filename = $image.attr('src');
				$('#avatar-data').val(JSON.stringify(d));
			},
			dragMode: 'crop',
			autoCrop: true,
 			autoCropArea: 1,
			movable: false,
			scalable: false,
			zoomable: false,
			toggleDragModeOnDblclick: false,
			background: false,
			viewMode: 0,
			minCropBoxWidth: 100,
			minCropBoxHeight: 100
		});
                $('#submit-avatar-button').removeAttr('disabled');
	});
	$('.r_left').on('click', function(){
		$image.cropper('rotate', -90);
	});
	$('.r_right').on('click', function(){
		$image.cropper('rotate', 90);
	});

      $('#avatar-file').bind('change', function(){
	var data = new FormData();
	var error = '';
	jQuery.each($('#avatar-file')[0].files, function(i, file) {

            if(file.name.length < 1) {             	
               error = error + ' Файл имеет неправильный размер! ';             
            }
            data.append('file-'+i, file);
	});
	$.ajax({
	    url: '/modules/upload_resize.php',
	    data: data,
	    cache: false,
	    contentType: false,
	    processData: false,
	    type: 'POST',error: function (xhr, ajaxOptions, thrownError) {
//         	alert(xhr.responseText);
// 	        alert(thrownError);
	    },
	    xhr: function () {
	        var xhr =  $.ajaxSettings.xhr();
	        xhr.upload.addEventListener("progress", function (evt) {
	            if (evt.lengthComputable) {
	                var pB = $('.progress-bar'), percentComplete = evt.loaded / evt.total, progLabel = Math.round(percentComplete * 100) + "%";
	                pB.attr('style', 'width: '+progLabel);
			pB.text(progLabel);
	            }
	        }, false);
	        return xhr;
	    },
	    beforeSend: function () {
	        $('.progress').show();
		$('.controls').hide();
	    },
	    complete: function () {
		$('.progress-bar').text('Готово.');
	        $('.progress').delay(2000).fadeOut(500);
		$('.controls').show();
	    },
	    success: function(data){
		$image.cropper('destroy');
		$image.attr('src', data);
	    }
	});
	});
	$('#submit-avatar-button').on('click', function (){
		var imageList = $('#image_selection'), selectImage = imageList.children('#select');
		var data = $('#avatar-data').attr('value');
		$.ajax({
			url: '/modules/addavatar.php',
			data: {'avatar-data':data},
			type: 'POST',
			error: function(xhr, ajaxOptions, thrownError){
//         	alert(xhr.responseText);
// 	        alert(thrownError);
			},
			success: function(data){
				data = JSON.parse(data);
				var n = $('<li id="'+data.filename+'"></li>').insertBefore(selectImage);
				n.append('<img width="50" src="data:image/jpeg;base64,'+data.mini+'" />');
				imagesList[data.filename] = true;
				$('<button type="button" class="btn btn-danger pull-right">Удалить</button>').appendTo(n)
				.on('click', function(){
					imagesList[n.attr('id')] = false;
					n.remove();
					imagesCount--;
					if (imagesCount > 0){
						$('#sendimages').removeAttr('disabled');
					} else {$('#sendimages').attr('disabled', true);}
					$('#image-selection-button').show();
				});
				imagesCount++;
				if (imagesCount>=maxImages){
					$('#image-selection-button').hide();
				}
				if (imagesCount > 0){
					$('#sendimages').removeAttr('disabled');
				} else {$('#sendimages').attr('disabled', true);}
				$('button[data-dismiss="modal"]').click();
			}
		});
	});
	$('#sendimages').on('click', function (){
		$('form#hidden').children('input[type="hidden"]').attr('value', JSON.stringify(imagesList));
		$('form#hidden').children('input[type="submit"]').click();
	});
    });
});

function selectImage(){
	$('#avatar-file').click();
}

http://jsonlint.com/ Ошибку показывает:

Error: Parse error on line 1:
$(document).ready(fu
^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'

, а как ее исправить не могу допереть. Главное на реальном хосте работает все.

На чтение 4 мин. Опубликовано 15.12.2019

I’m currently trying to write an Autohotkey command, which pastes a SQL code, but i only get this message:

Error at line 3. Line Text: Create table #tmp (
Error: This line does not contain a recognized action.
The script was not reloaded; the old Version will remain in effect.

there are also some variations of this message.

I already tried to use SendRaw or SendInput. Even the escape character ´ does not work. Putting it in quotation marks neither. I do not have any clues anymore.

well, i expected it to send the SQL-Statement, but I’m just getting errors like the one above. Sometimes it refers to the line «Create Table #tmp(«, sometimes to «insert into #tmp (row1, number)». And I don’t know what to do. Does anyone has a clue and can help me with this?

Содержание

  1. Comments
  2. quinnjamin commented Dec 8, 2014
  3. This comment has been minimized.
  4. valleyman86 commented Dec 14, 2014

Copy link Quote reply

At first it says «Error at line 15. The following variable name contains an illegal character: «File.Length» The program will exit.» I the only way i could get it to go away was to delete the period (.) but then it says «Error at line 21. Line Text: #If WinActive(«ahk_exe csgo.exe») Error: This line does not contain a recognized action. The program will exit.» I’m just having great difficulty getting this to work, I have never used anything like this (scripts or AutoHotKey) If you could help me it would be greatly appreciated!

Copy link Quote reply

Make sure you get the latest version of autohotkey.

On Sunday, December 7, 2014, quinnjamin notifications@github.com wrote:

At first it says «Error at line 15. The following variable name contains
an illegal character: «File.Length» The program will exit.» I the only way
i could get it to go away was to delete the period (.) but then it says
«Error at line 21. Line Text: #If WinActive(«ahk_exe csgo.exe») Error: This
line does not contain a recognized action. The program will exit.» I’m just
having great difficulty getting this to work, I have never used anything
like this (scripts or AutoHotKey) If you could help me it would be greatly
appreciated!


Reply to this email directly or view it on GitHub
#1.

Thread Tools
Display
  • Linear Mode
  • Switch to Hybrid Mode
  • Switch to Threaded Mode

Yeah maybe I’ll try that, I was thinking about it but thought it might take him off /follow but it doesn’t. I kind of wanted something that I didn’t have to conciously do every couple minutes but I guess jumping a couple times every 5 minutes isn’t hard lol.

EDIT: Meh.
This seems to work just fine. Dunno what I did wrong last time o.O

Numpad0::ControlSend, , , ahk_id %idClone%

Numpad0 Up::ControlSend, , , ahk_id %idClone% [/code:1]

I have this problem with ahk. Currently I’m testing with two computers: a normal desktop pc and a laptop. I’m running two wow clients on both of them so I have four characters now. Main character is A which ofcourse runs on my primary computer. On the same computer is also other char which is B. Char C is fullscreen client on my laptop and D is minimized client. I’m using Synergy/Multibox (both of them seems to work exactly the same in WoW) to broadcast my keys from desktop pc to laptop. So A and C which are on fullscreen work just fine but B and D causes some problems.

I’ve been searching some scripts from this forum but no matter which one I use it does not work properly. For example I have Frost Armor binded to «1». When I hold 1 down on my keyboard B and D casts their frost armor instantly and keep casting it as long as the button is hold down. A and C in the other hand cast it only after the button is released, which is ofcourse how it should work. So the problem is that ahk keeps spamming the button up and down as long as I keep it pressed down. Any ideas?

The scripts I’ve tested this with:

1::
ControlSend, , <1 down>, ahk_id %idClone%

1 Up::
ControlSend, , <1 up>, ahk_id %idClone%
[/code:1]
[code:1]#IfWinActive, World of Warcraft

2::
;ControlSend,, <1 down>, ahk_id %idMain%
ControlSend,, <1 down>, ahk_id %idClone%
KeyWait, 2
;ControlSend,, <1 up>, ahk_id %idMain%
ControlSend,, <1 up>, ahk_id %idClone%
Return[/code:1]
[code:1]#IfWinActive, World of Warcraft

Понравилась статья? Поделить с друзьями:
  • Error on line 1 at column 39 unsupported encoding unicode
  • Error on ingesting samples that are too old or are too far into the future
  • Error on ingesting out of order samples
  • Error on gpu3 device not responding check overclocking settings
  • Error on gpu1 an illegal memory access was encountered