FROM : Mark's Studio
DATE : Tue Oct 22 20:57:50 2002
Yes i know, but why does it not return YES with a scanLocation of 0,
if i use scanUpToString@"BC" it will return YES with scanLocation 1.
On tirsdag, okt 22, 2002, at 15:54 Europe/Copenhagen, Jirtme Laurens
wrote:
> Le mardi, 22 oct 2002, ` 14:56 Europe/Zurich, Mark's Studio a icrit :
>
>> I am trying to scan a text file, and i use this
>>
>> if([theScanner scanUpToString:@"ABC" intoString:NULL])
>>
>> if the textfile contains "ABC" at the beginning the scanner will not
>> find it, and it will not find the next "ABC".
>>
>> BUG???
>>
>
> no,
>
> the doc says that this method returns YES if some characters have been
> scanned NO otherwise.
> It stops just before the stopString!
>
> you can code like this
>
> if([theScanner scanUpToString: @"ABC" intoString: nil], [theScanner
> scanString: @"ABC" intoString: nil])
> {
> //do your job
> }
>
> or
>
> if([theScanner scanUpToString: @"ABC" intoString: nil], ![theScanner
> isAtEnd])
> {
> [theScanner setScanLocation: [theScanner scanLocation]+3];// 3 for
> [@"ABC" length]
> //do your job
> }
>
> it is not very efficient...
> _______________________________________________
> cocoa-dev mailing list | <email_removed>
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.
>
>
Peter Mark
Mark's Recording Studio A/S
Faelledvej 19 b DK2200 N
Copenhagen Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
<email_removed>
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Tue Oct 22 20:57:50 2002
Yes i know, but why does it not return YES with a scanLocation of 0,
if i use scanUpToString@"BC" it will return YES with scanLocation 1.
On tirsdag, okt 22, 2002, at 15:54 Europe/Copenhagen, Jirtme Laurens
wrote:
> Le mardi, 22 oct 2002, ` 14:56 Europe/Zurich, Mark's Studio a icrit :
>
>> I am trying to scan a text file, and i use this
>>
>> if([theScanner scanUpToString:@"ABC" intoString:NULL])
>>
>> if the textfile contains "ABC" at the beginning the scanner will not
>> find it, and it will not find the next "ABC".
>>
>> BUG???
>>
>
> no,
>
> the doc says that this method returns YES if some characters have been
> scanned NO otherwise.
> It stops just before the stopString!
>
> you can code like this
>
> if([theScanner scanUpToString: @"ABC" intoString: nil], [theScanner
> scanString: @"ABC" intoString: nil])
> {
> //do your job
> }
>
> or
>
> if([theScanner scanUpToString: @"ABC" intoString: nil], ![theScanner
> isAtEnd])
> {
> [theScanner setScanLocation: [theScanner scanLocation]+3];// 3 for
> [@"ABC" length]
> //do your job
> }
>
> it is not very efficient...
> _______________________________________________
> cocoa-dev mailing list | <email_removed>
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.
>
>
Peter Mark
Mark's Recording Studio A/S
Faelledvej 19 b DK2200 N
Copenhagen Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
<email_removed>
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Mark's Studio | Oct 22, 14:56 | |
| Jérôme Laurens | Oct 22, 15:54 | |
| Mark's Studio | Oct 22, 20:57 | |
| David P Henderson | Oct 22, 23:56 |






Cocoa mail archive

