Ответы с готовыми решениями:
«Illegal expression» при использовании процедуры Str
numY , numX integer; sY,sX string
if numY+numX = sum then begin
Str(numY , sY);
…
Найти сумму a2+a4+a6. Ошибка «illegal qualifier»
Даны целые числа a1, a2, …, a20. Найти сумму a2+a4+a6 … . Оператор цикла с шагом, отличным от 1…
Ошибка в AnsiString «E2206 Illegal character ‘*'»
Всем привет, возникла проблема с ошибкой в с++ builder, подскажите в чем проблема, новичок в с++….
Ошибка: Illegal character in input file: ‘»‘ ($22)
Есть процедура на событие OnClick
procedure TForm1.Button1Click(Sender: TObject);
begin
with…
1
Topic: Fatal: illegal character «‘($C2) (Read 11994 times)
Hello everybody,
I am using Lazarus in an Ubuntu 16.04 LTS virtual machine running in Parallels Version 13.3.2 (43368) on a Mac…
I used to write my Pascal code with spaces in sentences, such as a + b := c, or FCodeIso : Integer;
In my configuration, when compiling, I get quite often this error message :
PascalSourceFile.pas(position) Fatal: illegal character «‘($C2).
Before the ($C2) indication, there is a strange character like FF in a box on top on another unreadable character code.
I cannot determine what makes this error appear, because in the previous exemple the error may occur on either or neither of the «space» character I used. It seems that the error appear more often around the := operator, either in left or right position. But it is sometimes present in the declaration part of the code (I : Integer), and so on.
I have made a check with the latest Mint distribution running in Parallels on a Mac, and the error is also present. Lazarus is the only software I use presenting this behavior in my Virtual machines. I have detected this problem maybe years ago, with earlier versions of Lazarus, but now it is still present and I wish to use the EDI for playing around instead of Delphi.
Could someone give me a clue about this ?
Thanks in advance, best regards,
Thierry
Logged
$C2 (194 dec) is above 127. Sourcecode can not contain characters above Ascii 127 unless it is the conten of a a string or var or const.
I.E: you can not use characters above ASCII 127 in your Pascal sources, but you can use it in a string or char or const:string.
Also, $C2 has a different meaning depending on code page.
The compiler will show you exactly on which line and which position the culprit is.
In Western European languages it is usually Latin capital letter A with circumflex (A circonflex) and that is not allowed in Pascal code. Only for strings and chars as content, not even as variable name..
See https://www.ascii-code.com/
Pascal sourcecode (the language) itself is strictly limited to characters from 0..127 but the content of its variables are not (char, string)
BTW doesn’t depend on OS or platform.
« Last Edit: July 01, 2018, 01:26:52 pm by Thaddy »
Logged
I actually get compliments for being rude… (well, Dutch, but that is the same)
Thank you for your answer, but I know all of this. My question is : How comes that when I type in a Space (Chr 32) it ends sometimes with this strange codification ? I can insure you that I enter my code as usual, and that I have a HUGE typing experience, having been a COBOL developer for years…
Please note also that there is no real rule, sometimes it appears, sometimes not, in different contexts, in the procedural part as well as in the declarations. The only constant I see is that it replaces the space I entered, no other character.
Logged
Have you tried different versions of Lazarus on it?
Logged
Not sure if it’s the same, I think is had something similar on xubuntu , is tought it was when typing a quote ‘ it made a different quote.
Or perhaps I copied some source code, don’t know anymore…
I copied another quote to paste at the right places, wanted to look into this but forgot about it since it was just a small test on xubuntu to see if Lazarus would work.
Logged
Lazarus 2.2 / FPC 3.2.0 Windows 10
« Last Edit: July 01, 2018, 10:38:16 pm by Thaddy »
Logged
I actually get compliments for being rude… (well, Dutch, but that is the same)
Je ne sais pas ce qu’il fume lui, mais c’est de la bonne
Logged
DEO MERCHVRIO — Linux, Win10pro — Ryzen9XT 24threads + Geforce Rtx 3080SUPRIM
god of financial gain, commerce, eloquence (and thus poetry), messages, communication (including divination), travelers, boundaries, luck, trickery and thieves; he also serves as the guide of souls to the underworld
@ThierryJ
if you get such error, can you then save your code file and reopen it with another editor or , at best with an hexadecimal editor, and see what happens in the 3rd party editor?
Logged
DEO MERCHVRIO — Linux, Win10pro — Ryzen9XT 24threads + Geforce Rtx 3080SUPRIM
god of financial gain, commerce, eloquence (and thus poetry), messages, communication (including divination), travelers, boundaries, luck, trickery and thieves; he also serves as the guide of souls to the underworld
The compiler is showing part of the offending character.
U+00A0 No-Break Space is C2 A0 in UTF8.
Logged
@Handoko. I got this problem at least one year ago, when just playing a Hello World with the then current version.
@Fred : In this case, the problem occurs very frequently. I have been able to build the attached sample at the firs trial.
@Thaddy : No, I am using a Swiss French QWERTZ keyboard, without the uppercase accented A. And I repeat : I am a very good typer. We could do a race if you like it…
@mercuryho : I have attached a PDF showing the Lazarus problem, the Emacs view on the source and the Hex decoding.
@engkin : I know
To be short, I know what I type, I know my system, I know a lot… But I don’t know how a keystroke on the space bar becomes a strange unicode codification, sometimes. That is the point. Not what, but why and how.
I was thinking about a helping mechanism in the Lazarus editor that may in some circumstances add or modify a character ? In my far past, I remember such a problem in MMS, a source code management system running under VMS — VAX/AXP/… systems. In this case also we had one strange character appearing randomly in the «make file», we never identify the why… But VMS is far away today !
Notice, once more, I am in a VM running in Parallels, this may have an impact, I don’t know.
I will try to setup another VM running in VirtualBox and compare it, who knows ?
Thanks to all, anyway.
Thierry
Logged
I use VirtualBox on Linux, running Lazarus on VirtualBox so far is okay for me. Yes, please try it on VirtualBox and please report back the result.
Also, maybe you can test in on Parallels:
Create some simple test programs. The first one, drop a TMemo on the form. And the second one, drop a TSynEdit on the form. Then run the programs. If the issue won’t happen on TMemo but it happens on TSynEdit, well … that’s what I’m thinking about.
Logged
@Handoko
Thanks for your suggestion, I am going to test with the TMemo and TSynEdit.
Right now, I confirm that the problem is also present in the brand new VirtualBox Ubuntu16.04 LTS VM… It is exactly the same. Moreover, I rewrote the exemple attached in my previous message, the problem is in the exact same location.
Weird.
I go back to my tests…
Logged
@Handoko
I have made the test you suggested. One single form, with a TMemo and a TSynEdit, in the VirtualBox VM. I typed in both, separately, character by character, the following :
For i := 0 To High(machin) Do
Than I saved the Lines to separate files and checked both with ghex. Both have the same problem. So, the common denominator is the Mac, now ?
I am lost…
Logged
as suggested above, please configure an Oracle VirtualBox (it is free). Well some say it is slower than VMWare (I did not notice due to my PRO computers).
To be sure that is not the virtualizer software, which brings problems.
Regards.
Logged
DEO MERCHVRIO — Linux, Win10pro — Ryzen9XT 24threads + Geforce Rtx 3080SUPRIM
god of financial gain, commerce, eloquence (and thus poetry), messages, communication (including divination), travelers, boundaries, luck, trickery and thieves; he also serves as the guide of souls to the underworld
I use a computer running Linux Mint which is driving an emulated ReactOS, AND another one running W10 which is driving 3 emulated boxes as web servers (2 Ubuntu, 1 W7).
All of them are installed with Oracle VirtualBox and its ADDons. All of them have bidirectional clipboards activated. I did not notice strange keystrokes so far (even at passing texts by clipboards)
I use Laz on W7 and Mint, XE7 on W10
« Last Edit: July 02, 2018, 03:43:30 pm by mercurhyo »
Logged
DEO MERCHVRIO — Linux, Win10pro — Ryzen9XT 24threads + Geforce Rtx 3080SUPRIM
god of financial gain, commerce, eloquence (and thus poetry), messages, communication (including divination), travelers, boundaries, luck, trickery and thieves; he also serves as the guide of souls to the underworld
Прочтите прежде чем задавать вопрос!
1. Заголовок темы должен быть информативным. В противном случае тема удаляется …
2. Все тексты программ должны помещаться в теги [code=pas] … [/code], либо быть опубликованы на нашем PasteBin в режиме вечного хранения.
3. Прежде чем задавать вопрос, см. «FAQ«, если там не нашли ответа, воспользуйтесь ПОИСКОМ, возможно такую задачу уже решали!
4. Не предлагайте свои решения на других языках, кроме Паскаля (исключение — только с согласия модератора).
5. НЕ используйте форум для личного общения, все что не относится к обсуждению темы — на PM!
6. Одна тема — один вопрос (задача)
7. Проверяйте программы перед тем, как разместить их на форуме!!!
8. Спрашивайте и отвечайте четко и по существу!!!
Ошибка illegal character |
31.12.2009 17:20 Сообщение |
|
Новичок
Группа: Пользователи Репутация: 0 |
Recompiling because of C:fpc2.2.4bini386-win32pascal worktest.pas что оно означает? Добавлено через 3 мин. |
|
|
volvo |
31.12.2009 18:04 Сообщение |
Гость |
А чего ты не переключишь сообщения об ошибках на русский? Вот это же удобнее читать: Free Pascal Compiler version 2.2.4 [2009/04/10] for i386-win32 [Russian Edition]
|
|
|
nemq |
31.12.2009 18:30 Сообщение |
Новичок
Группа: Пользователи Репутация: 0 |
а как это сделать на free pascal? |
|
|
volvo |
1.01.2010 22:00 Сообщение |
Гость |
Вот тут я показывал, как это сделать… С Новым Годом. |
|
|
buy cialis online canadian pharm |
5.12.2021 17:48 Сообщение |
Гость |
comprar viagra generico sildenafil |
|
|
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0
Связь с администрацией: bu_gen в домене octagram.name
A breakdown of the error message for beginners in both Pascal and English:
The error message says many things:
`Fatal:` means that the error prevents further processing/running
`Syntax error` means that the code is incorrectly formulated
`; expected` means that the code parser expected to find a semicolon
`but VAR found` instead of the semicolon, the word VAR was found
`on line 14/1` means that the error was detected on line 14 in character position 1
Looking at the code (with line numbers)
11.const
12. vcharge=1000;
13. interrate=0.08
14.var
15. name,ward:string;
it is clear that the missing semicolon should be at the end of line 13 (actually it would be syntactically correct, if placed in the beginning of line 14, before the word ‘var’, but that is not how we write Pascal).
Форум программистов Vingrad
Модераторы: Poseidon |
Поиск: |
|
[Delphi] Ошибка ‘Illegal character’ |
Опции темы |
ВоВеЦ |
|
||
Шустрый Профиль Репутация: нет
|
hi
и выдаёт следующие ошибки: Проблема конешна не в строчки, но стопарится на ней=) Если нужно могу выложить весь исходный код! Никогда не сталкивался с подобными ошибками, может вы меня просветите в чём дело, буду вам оч блогадарен;) |
||
|
|||
Guedda |
|
||
Подрывник Профиль
Репутация: 6
|
Знаешь, я думаю, что ошибка в 17 строке. Понимаешь, что по одной строке трудно судить об общем состоянии дела. Но по ошибке ясно, что у тебя неправильные символы где-то… Так что умудрись либо весь код показать, илбо функцию, в которой находятся строки с 79 по 85. ——————— Ll 2 |
||
|
|||
ВоВеЦ |
|
||
Шустрый Профиль Репутация: нет
|
Вот вся процедура, включая строки с 79 по 85
Это сообщение отредактировал(а) ВоВеЦ — 21.11.2006, 08:37 |
||
|
|||
Guedda |
|
||
Подрывник Профиль
Репутация: 6
|
Тогда осмелюсь предположить, что ты не заполняешь Эдиты, и высвечиваются эти сообщения. А Эдиты следующие: ——————— Ll 2 |
||
|
|||
MBo |
|
||
Бывалый Профиль Репутация: 7
|
У тебя в файле неправильные переводы строк — видимо, ты скопировал текст откуда-то с юниксным $A вместо $D$A |
||
|
|||
Yanis |
|
||
Эксперт Профиль
Репутация: 4
|
ВоВеЦ ——————— *щёлк* |
||
|
|||
ВоВеЦ |
|
||
Шустрый Профиль Репутация: нет
|
Хм… Копировал я с Оперы, только один фиг переписал вручную код, один фиг тож самое, или я чтот недопонял? |
||
|
|||
Yanis |
|
||
Эксперт Профиль
Репутация: 4
|
ВоВеЦ ——————— *щёлк* |
||
|
|||
sergejzr |
|
||
Un salsero Профиль
Репутация: 11
|
Для домашних заданий, курсовых, существует «Центр Помощи». Тема перенесена! ——————— Me. |
||
|
|||
ВоВеЦ |
|
||
Шустрый Профиль Репутация: нет
|
тему можно вообще закрыть, Yanis держи + |
||
|
|||
|
Правила форума «Центр помощи» | |
|
ВНИМАНИЕ! Прежде чем создавать темы, или писать сообщения в данный раздел, ознакомьтесь, пожалуйста, с Правилами форума и конкретно этого раздела.
Более подробно с правилами данного раздела Вы можете ознакомится в этой теме. Если Вам помогли и атмосфера форума Вам понравилась, то заходите к нам чаще! С уважением, Poseidon, Rodman |
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) |
0 Пользователей: |
« Предыдущая тема | Центр помощи | Следующая тема » |