Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > IT форум > Помощь студентам
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 09.02.2009, 06:25   #1
Doget
Пользователь
 
Регистрация: 26.03.2008
Сообщений: 29
Восклицание Помогите разобраться в ошибке!

есть файл .txt надо расшифровать строчки в нем, они выглядят так
dfsgdsfg;dfsdsfls;jfsdkjf;an;324732 894
sdfasdfasdf;asdgdafgsac;dfgdsfgsdfg ;AC;2341451234541
через каждую запятую слово которое нужно запихнуть в переменную, а каждая строчка это один запрос, суть вот в чем:
когда я начинаю расшифровывать через stringList вылетает ошибка:
access violitation at address такойто in module 'user32.dll'
вот сам код:

assignfile(f,'c:\in\request.sarp');
reset(f);
for i:=1 to p do begin
readln(f,s);
a[i]:=s;
str.DelimitedText:= s;
str.Delimiter:=';';
fan:=str[0];
im:=str[1];
o:=str[2];
ser:=str[3];
num:=str[4];


что сдесь делаю неправильно не врублюсь ни как, если можете то поможете пожалуйста! оооочень вас прошу умные люди!Ё

Последний раз редактировалось Doget; 09.02.2009 в 08:51.
Doget вне форума Ответить с цитированием
Старый 09.02.2009, 08:44   #2
puporev
Старожил
 
Регистрация: 13.10.2007
Сообщений: 2,740
По умолчанию

Цитата:
for i:=1 to p do begin
readln(f,s);
a[i]:=s;
closefile(f);
Прочитал одну строку и закрываешь файл. А дальше откуда читать собираешься?

Попробуй так.
Код:
assignfile(f,'c:\in\request.sarp');
reset(f);
for i:=0 to p-1 do //если дальше пишешь a[0], то почему с 1 начинаешь?
   begin
     readln(f,a[i]);//зачем тебе s, если есть массив строк 
     str.DelimitedText:= a[i];
     str.Delimiter:=';';
   end;
closefile(f);
fan:=a[0];//откуда взялось str, если было а?
im:=a[1];
o:=a[2];
ser:=a[3];
num:=a[4];
puporev вне форума Ответить с цитированием
Старый 09.02.2009, 10:05   #3
Stilet
Белик Виталий :)
Старожил
 
Аватар для Stilet
 
Регистрация: 23.07.2007
Сообщений: 57,097
По умолчанию

А создавать str Пушкин будет?
Код:
str:=TStringList.Create
I'm learning to live...
Stilet вне форума Ответить с цитированием
Старый 09.02.2009, 10:24   #4
Doget
Пользователь
 
Регистрация: 26.03.2008
Сообщений: 29
По умолчанию

не а все равно выкидывает ошибку
Doget вне форума Ответить с цитированием
Старый 09.02.2009, 10:51   #5
Stilet
Белик Виталий :)
Старожил
 
Аватар для Stilet
 
Регистрация: 23.07.2007
Сообщений: 57,097
По умолчанию

А привести полный код в студию и сказать на какой строке не судьба?
I'm learning to live...
Stilet вне форума Ответить с цитированием
Старый 09.02.2009, 13:57   #6
Doget
Пользователь
 
Регистрация: 26.03.2008
Сообщений: 29
По умолчанию

все разобрался, цикл надо было добавить и все заработало
Doget вне форума Ответить с цитированием
Старый 09.02.2009, 20:18   #7
Loruoo18
Заблокирован
 
Регистрация: 31.01.2009
Сообщений: 5
Смущение further progress

“The only thing that will redeem mankind is cooperation.” - Bertrand RussellAs a blogger who has found some success amongst the seemingly endless sea of blogs, I’ve had to confront some old and rusty ideas I used to have about success and competition.I examined these long-held beliefs early on in my blogging career, and discovered that they were false.What I learned that has helped me tremendously, and these ideas can be applied to many fields of work and many areas of life: 1. Striving for success does not requre competition. 2. Boosting others actually helps you, in the long run. 3. Envy of others’ success and trying to tear others down helps NO ONE.The last one probably sounds obvious, but is also the idea that’s least used in reality by many people. For some reason, many of us get jealous when others are successful, and we try to tear the person down. We belittle them for their success, we criticize unfairly, we bad-mouth people, we become obstacles to their further progress.It’s utterly illogical, and yet you can find it everywhere in life, in many different cultures and industries. How does someone else’s success become a bad thing for other people? This is a concept I’d like to explore a little today, and I’d also like to take a look at the converse: how boosting people actually helps you.Success Isn’t a CompetitionBlogging, for example, is not a zero-sum game. If I gain readers, it doesn’t mean you’ll lose readers. In fact, if we as bloggers link to each other, we can help each other gain readers at the same time.Helping other bloggers, in that sense, does nothing to hurt you as a blogger. You aren’t competing for readers, even if you’re both trying to get the same readers, because readers can read multiple blogs.Sure, you might say that readers can only read so many blogs, so we are competing for their limited attention. But that’s a very limited and limiting view. That’s assuming that there’s a very limited pool of readers with a small amount of attention. That isn’t true: there are lots of blog readers out there, and even more, there are MANY non-blog readers who will soon become blog readers, and that number is increasing all the time.We aren’t competing for readers — we’re all trying to gain readership, but we can do that together, cooperatively if we like. Or we can compete and tear and claw at each other.This concept can apply wow gold to many other industries. I’ve been a writer in the field of journalism, and while some journalists think it’s a competition — you want to beat others by getting the story first (a scoop!) or you’re competing for limited jobs — I never agreed. We were all striving for the same goal: to tell the truth, and to get useful information to our readers. In that light, journalists can cooperate, and some of wow gold them actually do cooperate. Sharing of information is good for everybody.Think about maple story powerleveling your field of work: while the mainstream view is probably that everybody’s competing with each other, is there a way to see it as just the opposite? That we can all be successful, and that helping each other is actually a good thing?I would bet that you can see it that way. Think of it in terms of personal success: do you really need to maple story powerleveling compete with your peers in order to be a success? Can’t you all be successes, but in different ways? Maybe one person makes a million dollars, another successfully starts a small Business, another becomes famous for inventing something new, another becomes one of the most solid and hardest working people in his field. Those are all successes in different ways, and there are many, many more ways to be successful.maple story powerlevelingThere is a lot of use in this kind of view. Competition can be a motivator, and sometimes can be a lot of fun. But it can also be destructive, and become an obstacle to success. And if you see things as not a competition, that can lead to some really great things. Let’s take a look at that now.
Loruoo18 вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
WebBrowser - узнать об ошибке. AXS Работа с сетью в Delphi 3 11.09.2008 20:04
Выдать сообщение об ошибке Detka Общие вопросы Delphi 17 10.07.2008 15:06
Перехватить сообщение об ошибке Insainer Общие вопросы Delphi 5 25.04.2008 20:39
Перхват сообщения об ошибке!!!! chekanoff Общие вопросы Delphi 4 10.12.2007 10:14