![]() |
|
|
#1948 |
|
Aug 2006
3·1,993 Posts |
|
|
|
|
|
|
#1949 |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
|
|
|
|
|
|
#1950 |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
I have started to recollect codes I tried here and I made a .gp file and got gp reading it.
but: Code:
(21:02) gp > FaR("I hate you Alex","Alex","loser")
*** not a function: `FaR'.
Code:
FaR(string_to_search,string_to_find,string_to_replace_with)={
my(s1=Vec(string_to_search),s2=Vec(string_to_find),s3=string_to_replace_with,good,c="",d="");
for(i=0,#s1-#s2,
good=1;
for(j=1,#s2,
if(s2[j]!=s1[j+i],
good=0;
c=concat(c,s1[i+1]);
break
)
);
if(good,
d=concat(c,s3);
print1(d);
c="";i=i+#s2
)
);
}
Last fiddled with by science_man_88 on 2010-12-03 at 01:11 |
|
|
|
|
|
#1951 |
|
Aug 2006
3×1,993 Posts |
You probably aren't reading in the right file, then.
![]() If you have a file like this with all the functions you normally use, I strongly recommend reading it from your .gprc file so 1. You don't need to type the command to read it in each session 2. If you make changes to the file and want to read in those changes, you can just type "\r" instead of "\r filename.gp" since it already has the proper file loaded in the 'last file used' internal string. |
|
|
|
|
|
#1952 |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
first file
|
|
|
|
|
|
#1953 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
second file
|
|
|
|
|
|
#1954 |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
I must have the read set up wrong because I can paste the function in and I'm not given (c)-> stuff to show it's entered but then i can use it but if I don't I don't get it to work.
|
|
|
|
|
|
#1955 |
|
Aug 2006
3×1,993 Posts |
Let's try something first. Can you go to the command prompt for me? (Start, Run, then type cmd and press Enter.) Once there, type
Code:
cd "C:\Program Files\PARI" dir codes.* Last fiddled with by CRGreathouse on 2010-12-03 at 17:46 |
|
|
|
|
|
#1956 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Quote:
Code:
Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\flec>cd "C:\Program Files\PARI" C:\Program Files\PARI>dir codes.* Volume in drive C has no label. Volume Serial Number is 684A-E086 Directory of C:\Program Files\PARI 12/03/2010 01:42 PM 2,670 codes.gp 1 File(s) 2,670 bytes 0 Dir(s) 210,214,907,904 bytes free C:\Program Files\PARI> Last fiddled with by science_man_88 on 2010-12-03 at 18:32 |
|
|
|
|
|
|
#1957 |
|
Aug 2006
3·1,993 Posts |
Hmm, that looks fine. (From your shot of the Explorer window I thought it might have been named codes.gp.txt since Notepad likes to tack that on the names of all files.)
Try this: Open a new GP session and type ?0. What do you get? |
|
|
|
|
|
#1958 |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
nothing I also can't get rid of a drive I don't know how it came to be but I can virus scan it any way to get rid of it ? I supposedly don't have the permission to do anything but virus scan.
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why do I sometimes see all the <> formatting commands when I quote or edit? | cheesehead | Forum Feedback | 3 | 2013-05-25 12:56 |
| Passing commands to PARI on Windows | James Heinrich | Software | 2 | 2012-05-13 19:19 |
| Ubiquity commands | Mini-Geek | Aliquot Sequences | 1 | 2009-09-22 19:33 |
| 64-bit Pari? | CRGreathouse | Software | 2 | 2009-03-13 04:22 |
| Are these commands correct? | jasong | Linux | 2 | 2007-10-18 23:40 |